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

  • Thread starter Thread starter Srir
  • Start date Start date
S

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?
 
Srir said:
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,
 
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
 
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
 
Back
Top