Home All Groups Group Topic Archive Search About

Help regarding System.Net.HttpWebRequest.Create(tmpUrl)

Author
10 Nov 2005 10:18 PM
Srir
Hi,

I am having a strange problem with this method. This method fails with
certain URL's

I have this method in an executable and  i run the executable using a
spawned process
that is using, System.Diagnostics.Process proc = new
System.Diagnostics.Process();
and i run the process.

This method in exe fails for certain url's when executed through a
spawned prcocess only.

Can any one help me out why this happenning?

Author
10 Nov 2005 10:42 PM
Joerg Jooss
Srir wrote:

Show quote
> Hi,
>
> I am having a strange problem with this method. This method fails with
> certain URL's
>
> I have this method in an executable and  i run the executable using a
> spawned process
> that is using, System.Diagnostics.Process proc = new
> System.Diagnostics.Process();
> and i run the process.
>
> This method in exe fails for certain url's when executed through a
> spawned prcocess only.
>
> Can any one help me out why this happenning?

Can you provide some examples?

Cheers,
--
http://www.joergjooss.de
mailto:news-re***@joergjooss.de
Author
10 Nov 2005 10:56 PM
Sriram
for example...

i try to create use this method to get the http response as a string..

                     objRequest =
System.Net.HttpWebRequest.Create(tmpUrl)  <----------------
                    objResponse = objRequest.GetResponse()
                     sr = New
StreamReader(objResponse.GetResponseStream())
                    result = sr.ReadToEnd()

This method throws an exception when i run the Exe containing the above
method as a spawned process


        System.Diagnostics.Process proc = new System.Diagnostics.Process();
        proc.EnableRaisingEvents=false;
        proc.StartInfo.FileName = textBox1.Text +".exe";
        proc.StartInfo.Arguments=textBox2.Text;
        proc.StartInfo.Arguments=textBox3.Text;
        proc.Start();
        proc.WaitForExit();

The exe runs fine and does not throw an exception when i run the
executable through Command Line
but fails when i run the exe through the spawned process.

thank you sriram
Author
10 Nov 2005 11:05 PM
Sriram
for example...

i try to create use this method to get the http response as a string..

                     objRequest =
System.Net.HttpWebRequest.Create(tmpUrl)  <----------------
                    objResponse = objRequest.GetResponse()
                     sr = New
StreamReader(objResponse.GetResponseStream())
                    result = sr.ReadToEnd()

This method throws an exception when i run the Exe containing the above
method as a spawned process


        System.Diagnostics.Process proc = new System.Diagnostics.Process();
        proc.EnableRaisingEvents=false;
        proc.StartInfo.FileName = textBox1.Text +".exe";
        proc.StartInfo.Arguments=textBox2.Text;
        proc.StartInfo.Arguments=textBox3.Text;
        proc.Start();
        proc.WaitForExit();

The exe runs fine and does not throw an exception when i run the
executable through Command Line
but fails when i run the exe through the spawned process.

thank you sriram

AddThis Social Bookmark Button