请教c#htftpwebrequest 多线程程问题

相关文章:&&&&&&&&&&&&
最新添加资讯
24小时热门资讯
附近好友搜索httpwebrequest多线程出现的莫名其妙问题。_百度知道HttpWebRequest&与多线程
在多线程环境下使用HttpWebRequest,要注意如下事项
1 需要设置
ServicePointManager.DefaultConnectionLimit
数(默认连接数是 2)。
System.Net.ServicePointManager.DefaultConnectionLimit = 256;
2 用完的HttpWebRequest要Abort()或者要把 Response.Close()
&&&&&&&&&&&
HttpWebRequest request=
&&&&&&&&&&&
HttpWebResponse response=
&&&&&&&&&&&
Stream receiveStream=
&&&&&&&&&&&
StreamReader readStream =
&&&&&&&&&&&
&&&&&&&&&&&
&&&&&&&&&&&&&&&
request = (HttpWebRequest)WebRequest.Create(strUrl);
&&&&&&&&&&&&&&&
// Set some reasonable limits on resources used by this
&&&&&&&&&&&&&&&
request.MaximumAutomaticRedirections = 4;
&&&&&&&&&&&&&&&
request.MaximumResponseHeadersLength = 4;
&&&&&&&&&&&&&&&
request.Timeout = 1000 *15;
&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
// Set credentials to use for this request.
&&&&&&&&&&&&&&&
request.Credentials = CredentialCache.DefaultC
&&&&&&&&&&&&&&&
response = (HttpWebResponse)request.GetResponse();
&&&&&&&&&&&&&&&
receiveStream = response.GetResponseStream();
&&&&&&&&&&&&&&&&
&readStream = new StreamReader(receiveStream,
Encoding.GetEncoding("GBK"));
&&&&&&&&&&&&&&&
string strRes = (readStream.ReadToEnd());
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&
return strR
&&&&&&&&&&&
&&&&&&&&&&&
catch (System.Exception ex)
&&&&&&&&&&&
&&&&&&&&&&&&&&&
string strEx = "";
&&&&&&&&&&&&&&&
strEx = string.Format("sendhttp Exception:{1},{0}", strUrl,
ex.Message.ToString());
&&&&&&&&&&&&&&&
System.Threading.Thread.Sleep(3000);
&&&&&&&&&&&&&&&
return "Exception:" + strEx;
&&&&&&&&&&&
&&&&&&&&&&&
&&&&&&&&&&&
&&&&&&&&&&&&&&&
if (readStream != null)
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
readStream.Close();
&&&&&&&&&&&&&&&&&&&&&&&
readStream =
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
catch (System.Exception e1)
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
if (receiveStream != null)
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
receiveStream.Close();
&&&&&&&&&&&&&&&&&&&&&&&
receiveStream =
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
catch (System.Exception e1)
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
if (response != null)
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
response.Close();
&&&&&&&&&&&&&&&&&&&&&&&
response =
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
catch (System.Exception e1)
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
if (request != null)
&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
request.Abort();
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
catch (System.Exception e1)
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&&
&&&&&&&&&&&
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。/* .Net/C#: 实现支持断点续传多线程下载的 Http Web 客户端工具类 (C# DIY HttpWebClient)* Reflector 了一下 System.Net.WebClient ,改写或增加了若干:* DownLoad、Upload 相关方法!* DownLoad 相关改动较大!* 增加了 DataReceive、ExceptionOccurrs 事件!* 了解服务器端与客户端交互的 HTTP 协议参阅:* 使文件下载的自定义连接支持 FlashGet 的断点续传多线程链接下载! JSP/Servlet 实现!* http://blog.csdn.net/playyuer/archive//58430.aspx* 使文件下载的自定义连接支持 FlashGet 的断点续传多线程链接下载! C#/ASP.Net 实现!* http://blog.csdn.net/playyuer/archive//58281.aspx*/
修订: /* .Net/C#: 实现支持断点续传多线程下载的工具类* Reflector 了一下 System.Net.WebClient ,改写或增加了若干:* DownLoad、Upload 相关方法!* 增加了 DataReceive、ExceptionOccurrs 事件*/ namespace Microshaoft.Utils{using Susing System.IO;using System.Nusing System.Tusing System.Susing System.Tusing System.Collections.S ////// 记录下载的字节位置///public class DownLoadState{private string _FileN private string _AttachmentNprivate int _Pprivate string _RequestURL;private string _ResponseURL;private int _L private byte[] _D public string FileName{get{return _FileN}} public int Position{get{return _P}} public int Length{get{return _L}} public string AttachmentName{get{return _AttachmentN}} public string RequestURL{get{return _RequestURL;}} public string ResponseURL{get{return _ResponseURL;}} public byte[] Data{get{return _D}} internal DownLoadState(string RequestURL, string ResponseURL, string FileName, string AttachmentName, int Position, int Length, byte[] Data){this._FileName = FileNthis._RequestURL = RequestURL;this._ResponseURL = ResponseURL;this._AttachmentName = AttachmentNthis._Position = Pthis._Data = http://www./code/view/Dthis._Length = L} internal DownLoadState(string RequestURL, string ResponseURL, string FileName, string AttachmentName, int Position, int Length, ThreadCallbackHandler tch){this._RequestURL = RequestURL;this._ResponseURL = ResponseURL;this._FileName = FileNthis._AttachmentName = AttachmentNthis._Position = Pthis._Length = Lthis._ThreadCallback =} internal DownLoadState(string RequestURL, string ResponseURL, string FileName, string AttachmentName, int Position, int Length){this._RequestURL = RequestURL;this._ResponseURL = ResponseURL;this._FileName = FileNthis._AttachmentName = AttachmentNthis._Position = Pthis._Length = L} private ThreadCallbackHandler _ThreadC public HttpWebClient httpWebClient{get{return this._}set{this._hwc =}} internal Thread thread{get{return _}set{_thread =}} private HttpWebClient _private Thread _ //internal void StartDownloadFileChunk(){if (this._ThreadCallback != null){this._ThreadCallback(this._RequestURL, this._FileName, this._Position, this._Length);this._hwc.OnThreadProcess(this._thread);}} } //委托代理线程的所执行的方法签名一致public delegate void ThreadCallbackHandler(string S, string s, int I, int i); //异常处理动作public enum ExceptionActions{Throw,CancelAll,Ignore,Retry} ////// 包含 Exception 事件数据的类///public class ExceptionEventArgs : System.EventArgs{private System.Exception _Eprivate ExceptionActions _ExceptionA private DownLoadState _DownloadS public DownLoadState DownloadState{get{return _DownloadS}} public Exception Exception{get{return _E}} public ExceptionActions ExceptionAction{get{return _ExceptionA}set{_ExceptionAction =}} internal ExceptionEventArgs(System.Exception e, DownLoadState DownloadState){this._Exception =this._DownloadState = DownloadS}} ////// 包含 DownLoad 事件数据的类///public class DownLoadEventArgs : System.EventArgs{private DownLoadState _DownloadS public DownLoadState DownloadState{get{return _DownloadS}} public DownLoadEventArgs(DownLoadState DownloadState){this._DownloadState = DownloadS} } public class ThreadProcessEventArgs : System.EventArgs{private Thread _ public Thread thread{get{return this._}} public ThreadProcessEventArgs(Thread thread){this._thread =} } ////// 支持断点续传多线程下载的类///public class HttpWebClient{private static object _SyncLockObject = new object(); public delegate void DataReceiveEventHandler(HttpWebClient Sender, DownLoadEventArgs e); public event DataReceiveEventHandler DataR //接收字节数据事件 public delegate void ExceptionEventHandler(HttpWebClient Sender, ExceptionEventArgs e); public event ExceptionEventHandler ExceptionO //发生异常事件 public delegate void ThreadProcessEventHandler(HttpWebClient Sender, ThreadProcessEventArgs e); public event ThreadProcessEventHandler ThreadProcessE //发生多线程处理完毕事件 private int _FileL //下载文件的总大小 public int FileLength{get{return _FileL}} ////// 分块下载文件////// URL 地址/// 保存到本地的路径文件名/// 块数,线程数public void DownloadFile(string Address, string FileName, int ChunksCount){int p = 0; // positionint s = 0; // chunk sizestring a =HttpWebRHttpWebResponse hwrp =try{hwrq = (HttpWebRequest) WebRequest.Create(this.GetUri(Address));hwrp = (HttpWebResponse) hwrq.GetResponse();long L = hwrp.ContentL hwrq.Credentials = this.m_ L = ((L == -1) || (L > 0x7fffffff)) ? ((long) 0x7fffffff) : L; //Int32.MaxValue 该常数的值为 2,147,483,647; 即十六进制的 0x7FFFFFFF int l = (int) L; this._FileLength = // 在本地预定空间(竟然在多线程下不用先预定空间)// FileStream sw = new FileStream(FileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite);// sw.Write(new byte[l], 0, l);// sw.Close();// sw = bool b = (hwrp.Headers["Accept-Ranges"] != null & hwrp.Headers["Accept-Ranges"] == "bytes");a = hwrp.Headers["Content-Disposition"]; //attachmentif (a != null){a = a.Substring(a.LastIndexOf("filename=") + 9);}else{a = FileN} int ss =if (b){s = l / ChunksCif (s s){l -=if (l 0){DownLoadState x = new DownLoadState(Address, hwrp.ResponseUri.AbsolutePath, FileName, a, p, s, new ThreadCallbackHandler(this.DownloadFileChunk));// 单线程下载// x.StartDownloadFileChunk(); x.httpWebClient =//多线程下载Thread t = new Thread(new ThreadStart(x.StartDownloadFileChunk));//this.OnThreadProcess(t);t.Start(); }p +=}s =byte[] buffer = this.ResponseAsBytes(Address, hwrp, s, FileName);this.OnThreadProcess(Thread.CurrentThread); // lock (_SyncLockObject)// {// this._Bytes += buffer.L// }}}catch (Exception e){ExceptionActions ea = ExceptionActions.Tif (this.ExceptionOccurrs != null){DownLoadState x = new DownLoadState(Address, hwrp.ResponseUri.AbsolutePath, FileName, a, p, s);ExceptionEventArgs eea = new ExceptionEventArgs(e, x);ExceptionOccurrs(this, eea);ea = eea.ExceptionA} if (ea == ExceptionActions.Throw){if (!(e is WebException) && !(e is SecurityException)){throw new WebException("net_webclient", e);}}} } internal void OnThreadProcess(Thread t){if (ThreadProcessEnd != null){ThreadProcessEventArgs tpea = new ThreadProcessEventArgs(t);ThreadProcessEnd(this, tpea);}} ////// 下载一个文件块,利用该方法可自行实现多线程断点续传////// URL 地址/// 保存到本地的路径文件名/// 块大小public void DownloadFileChunk(string Address, string FileName, int FromPosition, int Length){HttpWebResponse hwrp =string a =try{//this._FileName = FileNHttpWebRequest hwrq = (HttpWebRequest) WebRequest.Create(this.GetUri(Address));//hwrq.Credentials = this.m_hwrq.AddRange(FromPosition);hwrp = (HttpWebResponse) hwrq.GetResponse();a = hwrp.Headers["Content-Disposition"]; //attachmentif (a != null){a = a.Substring(a.LastIndexOf("filename=") + 9);}else{a = FileN} byte[] buffer = this.ResponseAsBytes(Address, hwrp, Length, FileName);// lock (_SyncLockObject)// {// this._Bytes += buffer.L// }}catch (Exception e){ExceptionActions ea = ExceptionActions.Tif (this.ExceptionOccurrs != null){DownLoadState x = new DownLoadState(Address, hwrp.ResponseUri.AbsolutePath, FileName, a, FromPosition, Length);ExceptionEventArgs eea = new ExceptionEventArgs(e, x);ExceptionOccurrs(this, eea);ea = eea.ExceptionA} if (ea == ExceptionActions.Throw){if (!(e is WebException) && !(e is SecurityException)){throw new WebException("net_webclient", e);}}}} internal byte[] ResponseAsBytes(string RequestURL, WebResponse Response, long Length, string FileName){string a = //AttachmentNameint P = 0; //整个文件的位置指针int num2 = 0;try{a = Response.Headers["Content-Disposition"]; //attachmentif (a != null){a = a.Substring(a.LastIndexOf("filename=") + 9);} long num1 = L //Response.ContentLbool flag1 =if (num1 == -1){flag1 =num1 = 0x10000; //64k}byte[] buffer1 = new byte[(int) num1]; int p = 0; //本块的位置指针 string s = Response.Headers["Content-Range"];if (s != null){s = s.Replace("bytes ", "");s = s.Substring(0, s.IndexOf("-"));P = Convert.ToInt32(s);}int num3 = 0; Stream S = Response.GetResponseStream();do{num2 = S.Read(buffer1, num3, ((int) num1) - num3); num3 += num2;if (flag1 && (num3 == num1)){num1 += 0x10000;byte[] buffer2 = new byte[(int) num1];Buffer.BlockCopy(buffer1, 0, buffer2, 0, num3);buffer1 = buffer2;} // lock (_SyncLockObject)// {// this._bytes += num2;// }if (num2 > 0){if (this.DataReceive != null){byte[] buffer = new byte[num2];Buffer.BlockCopy(buffer1, p, buffer, 0, buffer.Length);DownLoadState dls = new DownLoadState(RequestURL, Response.ResponseUri.AbsolutePath, FileName, a, P, num2, buffer);DownLoadEventArgs dlea = new DownLoadEventArgs(dls);//触发事件this.OnDataReceive(dlea);//.Threading.Thread.Sleep(100); }p += num2; //本块的位置指针P += num2; //整个文件的位置指针}else{} }while (num2 != 0); S.Close();S =if (flag1){byte[] buffer3 = new byte[num3];Buffer.BlockCopy(buffer1, 0, buffer3, 0, num3);buffer1 = buffer3;}return buffer1;}catch (Exception e){ExceptionActions ea = ExceptionActions.Tif (this.ExceptionOccurrs != null){DownLoadState x = new DownLoadState(RequestURL, Response.ResponseUri.AbsolutePath, FileName, a, P, num2);ExceptionEventArgs eea = new ExceptionEventArgs(e, x);ExceptionOccurrs(this, eea);ea = eea.ExceptionA} if (ea == ExceptionActions.Throw){if (!(e is WebException) && !(e is SecurityException)){throw new WebException("net_webclient", e);}}}} private void OnDataReceive(DownLoadEventArgs e){//触发数据到达事件DataReceive(this, e);} public byte[] UploadFile(string address, string fileName){return this.UploadFile(address, "POST", fileName, "file");} public string UploadFileEx(string address, string method, string fileName, string fieldName){return Encoding.ASCII.GetString(UploadFile(address, method, fileName, fieldName));} public byte[] UploadFile(string address, string method, string fileName, string fieldName){byte[] buffer4;FileStream stream1 =try{fileName = Path.GetFullPath(fileName);string text1 = "---------------------" + DateTime.Now.Ticks.ToString("x"); string text2 = "application/octet-stream"; stream1 = new FileStream(fileName, FileMode.Open, FileAccess.Read);WebRequest request1 = WebRequest.Create(this.GetUri(address));request1.Credentials = this.m_request1.ContentType = "multipart/form- boundary=" + text1; request1.Method =string[] textArray1 = new string[7] {"--", text1, "\r\nContent-Disposition: form- name=\"" + fieldName + "\"; filename=\"", Path.GetFileName(fileName), "\"\r\nContent-Type: ", text2, "\r\n\r\n"};string text3 = string.Concat(textArray1);byte[] buffer1 = Encoding.UTF8.GetBytes(text3);byte[] buffer2 = Encoding.ASCII.GetBytes("\r\n--" + text1 + "\r\n");long num1 = 0x7try{num1 = stream1.Lrequest1.ContentLength = (num1 + buffer1.Length) + buffer2.L}catch{}byte[] buffer3 = new byte[Math.Min(0x2000, (int) num1)];using (Stream stream2 = request1.GetRequestStream()){int num2;stream2.Write(buffer1, 0, buffer1.Length);do{num2 = stream1.Read(buffer3, 0, buffer3.Length);if (num2 != 0){stream2.Write(buffer3, 0, num2);}}while (num2 != 0);stream2.Write(buffer2, 0, buffer2.Length);}stream1.Close();stream1 =WebResponse response1 = request1.GetResponse(); buffer4 = this.ResponseAsBytes(response1);}catch (Exception exception1){if (stream1 != null){stream1.Close();stream1 =}if (!(exception1 is WebException) && !(exception1 is SecurityException)){//throw new WebException(SR.GetString("net_webclient"), exception1);throw new WebException("net_webclient", exception1);}}return buffer4;} private byte[] ResponseAsBytes(WebResponse response){int num2;long num1 = response.ContentLbool flag1 =if (num1 == -1){flag1 =num1 = 0x10000;}byte[] buffer1 = new byte[(int) num1];Stream stream1 = response.GetResponseStream();int num3 = 0;do{num2 = stream1.Read(buffer1, num3, ((int) num1) - num3);num3 += num2;if (flag1 && (num3 == num1)){num1 += 0x10000;byte[] buffer2 = new byte[(int) num1];Buffer.BlockCopy(buffer1, 0, buffer2, 0, num3);buffer1 = buffer2;}}while (num2 != 0);stream1.Close();if (flag1){byte[] buffer3 = new byte[num3];Buffer.BlockCopy(buffer1, 0, buffer3, 0, num3);buffer1 = buffer3;}return buffer1;} private NameValueCollection m_requestPprivate Uri m_baseAprivate ICredentials m_credentials = CredentialCache.DefaultC public ICredentials Credentials{get{return this.m_}set{this.m_credentials =}} public NameValueCollection QueryString{get{if (this.m_requestParameters == null){this.m_requestParameters = new NameValueCollection();}return this.m_requestP}set{this.m_requestParameters =}} public string BaseAddress{get{if (this.m_baseAddress != null){return this.m_baseAddress.ToString();}return string.E}set{if ((value == null) || (value.Length == 0)){this.m_baseAddress =}else{try{this.m_baseAddress = new Uri(value);}catch (Exception exception1){throw new ArgumentException("value", exception1);}}}} private Uri GetUri(string path){Uri uri1;try{if (this.m_baseAddress != null){uri1 = new Uri(this.m_baseAddress, path);}else{uri1 = new Uri(path);}if (this.m_requestParameters == null){return uri1;}StringBuilder builder1 = new StringBuilder();string text1 = string.Efor (int num1 = 0; num1 < this.m_requestParameters.C num1++){builder1.Append(text1 + this.m_requestParameters.AllKeys[num1] + "=" + this.m_requestParameters[num1]);text1 = "&";}UriBuilder builder2 = new UriBuilder(uri1);builder2.Query = builder1.ToString();uri1 = builder2.U}catch (UriFormatException){uri1 = new Uri(Path.GetFullPath(path));}return uri1;} } } ////// 测试类///class AppTest{int _k = 0;int _K = 0; static void Main(){AppTest a = new AppTest();Microshaoft.Utils.HttpWebClient x = new Microshaoft.Utils.HttpWebClient(); a._K = 10; //订阅 DataReceive 事件x.DataReceive += new Microshaoft.Utils.HttpWebClient.DataReceiveEventHandler(a.x_DataReceive);//订阅 ExceptionOccurrs 事件x.ExceptionOccurrs += new Microshaoft.Utils.HttpWebClient.ExceptionEventHandler(a.x_ExceptionOccurrs); x.ThreadProcessEnd += new Microshaoft.Utils.HttpWebClient.ThreadProcessEventHandler(a.x_ThreadProcessEnd);string F = "http:///download/phpMyAdmin-2.6.1-pl2.zip";a._F = F;F = "http://localhost/download/jdk-1_5_0_01--i586-p.aa.exe"; string f = F.Substring(F.LastIndexOf("/") + 1); //(new System.Threading.Thread(new System.Threading.ThreadStart(new ThreadProcessState(F, @"E:\temp\" + f, 10, x).StartThreadProcess))).Start(); x.DownloadFile(F, @"E:\temp\temp\" + f, a._K);// x.DownloadFileChunk(F, @"E:\temp\" + f,15,34556); System.Console.ReadLine();// string uploadfile = "e:\\test_local.rar";// string str = x.UploadFileEx("http://localhost/phpmyadmin/uploadaction.php", "POST", uploadfile, "file1");// System.Console.WriteLine(str);// System.Console.ReadLine();} string bs = ""; //用于记录上次的位数bool b =private int i = 0;private static object _SyncLockObject = new object();string _F;string _f; private void x_DataReceive(Microshaoft.Utils.HttpWebClient Sender, Microshaoft.Utils.DownLoadEventArgs e){if (!this.b){lock (_SyncLockObject){if (!this.b){System.Console.Write(System.DateTime.Now.ToString() + " 已接收数据: ");//System.Console.Write( System.DateTime.Now.ToString() + " 已接收数据: ");this.b =}}}string f = e.DownloadState.FileNif (e.DownloadState.AttachmentName != null)f = System.IO.Path.GetDirectoryName(f) + @"\" + e.DownloadState.AttachmentN this._f = using (System.IO.FileStream sw = new System.IO.FileStream(f, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.ReadWrite, System.IO.FileShare.ReadWrite)){sw.Position = e.DownloadState.Psw.Write(e.DownloadState.Data, 0, e.DownloadState.Data.Length);sw.Close();}string s = System.DateTime.Now.ToString();lock (_SyncLockObject){this.i += e.DownloadState.Data.LSystem.Console.Write(bs + "\b\b\b\b\b\b\b\b\b\b" + i + " / " + Sender.FileLength + " 字节数据 " + s);//System.Console.Write(bs + i + " 字节数据 " + s);this.bs = new string('\b', Digits(i) + 3 + Digits(Sender.FileLength) + s.Length);}} int Digits(int n) //数字所占位数{n = System.Math.Abs(n);n = n / 10;int i = 1;while (n & 0){n = n / 10;i++;}} private void x_ExceptionOccurrs(Microshaoft.Utils.HttpWebClient Sender, Microshaoft.Utils.ExceptionEventArgs e){System.Console.WriteLine(e.Exception.);//发生异常重新下载相当于断点续传,你可以自己自行选择处理方式Microshaoft.Utils.HttpWebClient x = new Microshaoft.Utils.HttpWebClient();x.DownloadFileChunk(this._F, this._f, e.DownloadState.Position, e.DownloadState.Length);e.ExceptionAction = Microshaoft.Utils.ExceptionActions.I} private void x_ThreadProcessEnd(Microshaoft.Utils.HttpWebClient Sender, Microshaoft.Utils.ThreadProcessEventArgs e){//if (e.thread.ThreadState == System.Threading.ThreadState.Stopped)if (this._k ++ == this._K - 1)System.Console.WriteLine(&\nend&);}}

我要回帖

更多关于 request 多线程 的文章

 

随机推荐