Calling HttpWebRequest.GetResponse() hangs my program!

M

Mahernoz

Hi Friends,

I have this code in a C# console application which calls a URL on my
website(Asp.net/C#) with Querystrings. (I have also tried without
querystrings).

The problem is my program gets hanged. Even no error message is
displayed.

HttpWebRequest req =
(HttpWebRequest)WebRequest.Create(CaptureURLForScheduler +
strQueryString);
req.Method = "POST";

ASCIIEncoding encoding = new ASCIIEncoding();
byte[] byte1 = encoding.GetBytes(strQueryString);
req.ContentLength = byte1.Length;

//This line hangs my program
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
//This line hangs my program

Can you tell me what's going on and how can i fix this?

Regards,
Mahernoz
 
G

Guest

See answer in the C# group. No need to cross-post, it just makes it harder
for people to know which is the active thread.
 
A

Anthony Jones

Peter Bromberg said:
See answer in the C# group. No need to cross-post, it just makes it harder
for people to know which is the active thread.

Did you mean multi-post? Cross posting is fine if it really is ambigous
which group a question ought to be posted.
 
A

Anthony Jones

Peter Bromberg said:
Right. No need to split hairs, I am sure the OP got the picture if he / she
posesses an above room-temperature IQ. :)

Most people who multi-post have never heard the terms multi-post or
cross-post.

I therefore should have in fact been more explicit.

Multi-post: To post the same question to various groups as individuals
messages. Replies to these messages only appear in the group in which it
was found.

Cross-port: To post the same question to various groups by addressing a
single message to multiple groups. By default when replying a newsreader
will address the reply to all groups that the orignal message was posted to.
Hence the reply will be seen in all groups not just the one it was found in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top