开发者

Asynchronous HttpWebRequest giving exception in C# language compact framework?

开发者 https://www.devze.com 2022-12-23 05:19 出处:网络
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

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

精彩评论

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

关注公众号