大佬教程收集整理的这篇文章主要介绍了silverlight – HttpWebRequest.EndGetResponse在Windows Phone 7中抛出NotSupportedException异常,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
public class httpUploadHelper { private httpWebrequest request; private requestState state = new requestState(); public httpUploadHelper(String url) { this.request = Webrequest.Create(url) as httpWebrequest; state.request = request; } public void Execute() { request.Method = "POST"; this.request.beginGetrequestStream( new AsyncCallBACk(Beginrequest),statE); } private void Beginrequest(IAsyncResult ar) { Stream stream = state.request.EndGetrequestStream(ar); state.request.beginGetResponse( new AsyncCallBACk(BeginResponsE),statE); } private void BeginResponse(IAsyncResult ar) { // BOOM: NotSupportedException was unhandled; // {System.Net.browser.oHWRAsyncResult} // AsyncWaitHandle = 'ar.AsyncWaitHandle' threw an // exception of type 'System.NotSupportedException' httpWebResponse response = state.request.EndGetResponse(ar) as httpWebResponse; Debug.WriteLine(response.StatusCodE); } } public class requestState { public Webrequest request; }
}
有人知道这段代码有什么问题吗?
private void Beginrequest(IAsyncResult ar) { using (Stream stream = request.EndGetrequestStream(ar)) { //write to stream in here. } state.request.beginGetResponse( new AsyncCallBACk(BeginResponsE),statE); }
以上是大佬教程为你收集整理的silverlight – HttpWebRequest.EndGetResponse在Windows Phone 7中抛出NotSupportedException异常全部内容,希望文章能够帮你解决silverlight – HttpWebRequest.EndGetResponse在Windows Phone 7中抛出NotSupportedException异常所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。