开发者

Asynchronous HttpWebRequest giving exception in C# language compact framework?

I have pasted the code from msdn, from http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetrequeststream.aspx in a sample application. But this gives error for contentLengh, so i have provided that. then it executes well. But at following point, it throws exception of InvalidOperationException and NotSupportedExcept开发者_开发百科ion.

Stream postStream = request.EndGetRequestStream(asynchronousResult); //dies here

I tried the code in my application with my web service, but still the same exception.

I have tried request.sendChunked = true, but that does not resolve the error.

I dont know what is wrong with it.

I am coding with c# on net compact framework, I have a login page, for which login request goes to server. Then I want to show a page with custom progress bar on login request, and hide the page when I get back the response. So I am using asynchronous HttpWebRequest. Please help, if anything is wrong in the code, or if there is some other solution to show the custom progress bar. any help would be greatly appreciated.

Thanks in advance. Mishal Shah

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜