|
@@ -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
|
|
|
|
|
|
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
|