C#程序开发中,使用WebClient实例出现不支持并发I/O操作的异常提示“WebClient does not support concurrent I/O operations ”,解决方法也很简单,使用几个WebClient实例,就new几个WebClient
Stream stream1 = client1.OpenRead(URLAddress); Stream stream2 = client2.OpenRead(URLAddress2);
在上述代码段中出现了两个client实例,一个是client1,一个是client2,为保证两行代码都能正常运行,就需要在代码段前new两个webclient实例
private WebClient client1 = new WebClient(); private WebClient client2 = new WebClient();//创建第二个WebClient实例,解决WebClient不能并发I/O操作问题
微信公众号 weisico-com
转载请注明:微思考学习网-关注技术,分享知识 >> webclient不支持并发I/o操作的解决办法
ASP.NET微软MsChart图表实例之
ASP.NET微软图表控件MsChart实
PopupWin应用ASP.NET在web页面
ASP.NET MVC3 从零开始一步步
ASP.NET显示渐变图片
解决ASP.NET之Timeout时间已到
ASP.NET上传图片生成缩略图及
ASP.NET上传图片添加文字水印