| 
					
				 | 
			
			
				@@ -12,6 +12,8 @@ using System.Security.Cryptography.X509Certificates; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using System.Net.Security; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using System.Linq; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 using System.Net.Cache; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using System.Diagnostics; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+using SXLibrary; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 namespace SufeiUtil 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -42,6 +44,9 @@ namespace SufeiUtil 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         /// <returns>返回HttpResult类型</returns> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         public HttpResult GetHtml(HttpItem item) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 计算函数耗时; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Stopwatch stopwatch = new Stopwatch(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            stopwatch.Start(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //返回参数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             HttpResult result = new HttpResult(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             try 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -51,12 +56,15 @@ namespace SufeiUtil 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             catch (Exception ex) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                // 停止计时; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                stopwatch.Stop();                
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Log.WriteTimesdLog(string.Format("\r\n配置参数时出错 url={0}\r\nPostdata={1}\r\nElapsed={2}ms\r\n", item.URL, item.Postdata, stopwatch.ElapsedMilliseconds.ToString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                stopwatch.Reset(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //配置参数时出错 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 return new HttpResult() { Cookie = string.Empty, Header = null, Html = ex.Message, StatusDescription = "配置参数时出错:" + ex.Message }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             try 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 //请求数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 using (response = (HttpWebResponse)request.GetResponse()) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -88,6 +96,11 @@ namespace SufeiUtil 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 request = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 response = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            // 停止计时; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            stopwatch.Stop();            
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            Log.WriteTimesdLog(string.Format("\r\nurl={0}\r\nPostdata={1}\r\nResult={2}\r\nStatus={3}\r\nElapsed={4}ms\r\n",  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                item.URL, item.Postdata, result.Html, result.StatusDescription, stopwatch.ElapsedMilliseconds.ToString())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            stopwatch.Reset(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             return result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         #endregion 
			 |