資源簡介
基于 HttpHelper萬能框架V2.2 源碼基礎 上,修復了cookie 合并的問題,以及 ssl 基礎連接已關閉的問題。作者你為什么要舉報我?
1, cookie 修復
internal static string GetMergeCookie(string oldCookie, string newCookie)
{
if (!string.IsNullOrEmpty(oldCookie) && !string.IsNullOrEmpty(newCookie))
{
if (oldCookie == newCookie)
return oldCookie;
else
{
List Old = new List(oldCookie.Split(';'));
List New = new List(newCookie.Split(';'));
foreach (string n in New)
{
foreach (string o in Old)
{
if (o == n || o.Split('=')[0] == n.Split('=')[0])
{
Old.Remove(o);
break;
}
}
}
List list = new List(Old);
list.AddRange(New);
StringBuilder sb = new StringBuilder();
foreach (var s in list)
{
if (s != "")
{
sb.Append(s).Append(";");
}
}
return sb.ToString();
}
}
else if (!string.IsNullOrEmpty(oldCookie))
{
return oldCookie;
}
else if (!string.IsNullOrEmpty(newCookie))
{
return newCookie;
}
else
{
return "";
}
}
2,ssl 修復
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Ssl3 | (SecurityProtocolType)3072 | (SecurityProtocolType)192 | (SecurityProtocolType)768;

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Linq;
using?System.Text;
using?System.Net;
using?CsharpHttpHelper.baseBll;
using?System.Drawing;
using?CsharpHttpHelper.Helper;
using?CsharpHttpHelper.Item;
using?System.Collections.Specialized;
using?System.Runtime.Remoting.Messaging;
namespace?CsharpHttpHelper
{
????///?
????///?gethtml方法異步調用的委托
????///?
????///?
????///?
????public?delegate?void?ResultHandler(HttpResult?item);
????///?
????///?Http幫助類??Copyright:http://www.httphelper.com/
????///?版本:2.2.0
????///?作者:蘇飛
????///?更新時間:2018-7-2
????///?
????public?class?HttpHelper
????{
????????#region?Private?Obj
????????///?
????????///?HttpHelperBLL
????????///?
????????private?HttpHelperBll?bll?=?new?HttpHelperBll();
????????///?
????????///?gethtml方法異步調用的委托
????????///?
????????///?
????????///?
????????private?delegate?HttpResult?GethtmlHandler(HttpItem?item);
????????///?
????????///?異步調用方法委托
????????///?
????????private?ResultHandler?resultheadler;
????????#endregion
????????#region?HttpHelper
????????///?
????????///?根據相傳入的數據,得到相應頁面數據
????????///?
????????///?參數類對象
????????///?返回HttpResult類型
????????public?HttpResult?GetHtml(HttpItem?item)
????????{
????????????return?bll.GetHtml(item);
????????}
????????///?
????????///?GetHtml方法的異步調用方式,根據相傳入的數據,得到相應頁面數據
????????///?
????????///?參數類對象
????????///?回調的方法名
????????public?void?BeginInvokeGetHtml(HttpItem?item?ResultHandler?resultMainName)
????????{
????????????resultheadler?=?resultMainName;
????????????GethtmlHandler?handler?=?new?GethtmlHandler(GetHtml);
????????????handler.BeginInvoke(item?new?AsyncCallback(CallbackFunc)?“AsycState:OK“);
????????}
????????///?
????????///?內部回調方法
????????///?
????????///?返回值
????????private?void?CallbackFunc(IAsyncResult?resultType)
????????{
????????????//result?是“加法類.Add()方法”的返回值?????????????
????????????//AsyncResult?是IAsyncResult接口的一個實現類,引用空間:System.Runtime.Remoting.Messaging?????????????
????????????//AsyncDelegate?屬性可以強制轉換為用戶定義的委托的實際類。
????????????GethtmlHandler?handler?=?(GethtmlHandler)((AsyncResult)resultType).AsyncDelegate;
????????????HttpResult?result?=?handler.EndInvoke(resultType);
????????????//回調方法傳回執行結果
????????????resultheadler.Invoke(result);
????????}
????????///?
????????///?根據Url獲取圖片
????????///?
????????///?HttpItem參數
????????///?返回圖片,錯誤為NULL
????????public?Image?GetImage(HttpItem?item)
????????{
????????????return?bll.GetImage(item);
????????}
????????///?
????????///?快速請求方
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????85618??2019-01-15?14:22??HttpHelper萬能框架V2.2\.vs\config\applicationhost.config
????..A..H.?????50688??2019-03-26?11:13??HttpHelper萬能框架V2.2\.vs\CsharpHttpHelper\v15\.suo
?????文件??????????0??2019-01-15?14:22??HttpHelper萬能框架V2.2\.vs\CsharpHttpHelper\v15\Server\sqlite3\db.lock
?????文件???????4096??2019-01-15?14:22??HttpHelper萬能框架V2.2\.vs\CsharpHttpHelper\v15\Server\sqlite3\storage.ide
?????文件??????32768??2019-03-26?11:08??HttpHelper萬能框架V2.2\.vs\CsharpHttpHelper\v15\Server\sqlite3\storage.ide-shm
?????文件????3287792??2019-03-25?21:48??HttpHelper萬能框架V2.2\.vs\CsharpHttpHelper\v15\Server\sqlite3\storage.ide-wal
?????文件??????21372??2019-03-25?21:49??HttpHelper萬能框架V2.2\CsharpHttpHelper\ba
????.......??????2731??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\ba
?????文件??????33280??2019-03-26?11:08??HttpHelper萬能框架V2.2\CsharpHttpHelper\bin\Debug\HttpHelper.dll
?????文件?????103936??2019-03-26?11:08??HttpHelper萬能框架V2.2\CsharpHttpHelper\bin\Debug\HttpHelper.pdb
?????文件??????46662??2019-03-26?11:08??HttpHelper萬能框架V2.2\CsharpHttpHelper\bin\Debug\HttpHelper.xm
?????文件???????3857??2019-01-15?14:42??HttpHelper萬能框架V2.2\CsharpHttpHelper\CsharpHttpHelper.csproj
????.......???????458??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Enum\AType.cs
????.......???????747??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Enum\PostDataType.cs
????.......???????678??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Enum\ResultCookieType.cs
????.......???????703??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Enum\ResultType.cs
????.......??????1516??2018-04-08?17:23??HttpHelper萬能框架V2.2\CsharpHttpHelper\Helper\ba
????.......??????1179??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Helper\EncodingHelper.cs
????.......??????2081??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Helper\ExecJsHelper.cs
????.......??????5678??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Helper\HtmlHelper.cs
?????文件???????5966??2019-01-15?15:53??HttpHelper萬能框架V2.2\CsharpHttpHelper\Helper\HttpCookieHelper.cs
????.......??????4147??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Helper\HttpUrlHelper.cs
????.......???????723??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Helper\ImageHelper.cs
????.......??????1470??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Helper\Json
????.......??????1340??2018-04-28?17:10??HttpHelper萬能框架V2.2\CsharpHttpHelper\Helper\MD5Helper.cs
?????文件??????14026??2019-01-15?15:55??HttpHelper萬能框架V2.2\CsharpHttpHelper\HttpHelper.cs
????.......?????11759??2018-03-12?13:45??HttpHelper萬能框架V2.2\CsharpHttpHelper\HttpItem.cs
????.......??????2877??2018-07-02?14:10??HttpHelper萬能框架V2.2\CsharpHttpHelper\HttpResult.cs
????.......???????923??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Item\AItem.cs
????.......???????499??2017-07-04?11:14??HttpHelper萬能框架V2.2\CsharpHttpHelper\Item\ImgItem.cs
............此處省略94個文件信息
- 上一篇:國外WAF繞過姿勢.pdf
- 下一篇:基于ADAMS的牛頭刨床運動分析
評論
共有 條評論