Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Calling HttpWebRequest.GetResponse() hangs my program!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mahernoz - 17 Oct 2007 11:27 GMT
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
Peter Bromberg [C# MVP] - 17 Oct 2007 12:20 GMT
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.
Signature

Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> Hi Friends,
>
[quoted text clipped - 22 lines]
> Regards,
> Mahernoz
Anthony Jones - 17 Oct 2007 13:15 GMT
> 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.

Signature

Anthony Jones - MVP ASP/ASP.NET

Peter Bromberg [C# MVP] - 17 Oct 2007 21:12 GMT
Right. No need to split hairs, I am sure the OP got the picture if he / she
posesses an above room-temperature IQ. :-)
Signature

Recursion: see Recursion
site:  http://www.eggheadcafe.com
unBlog:  http://petesbloggerama.blogspot.com
BlogMetaFinder:    http://www.blogmetafinder.com

> > 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.
Anthony Jones - 19 Oct 2007 20:28 GMT
> 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.

Signature

Anthony Jones - MVP ASP/ASP.NET


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.