-
大小: 675KB文件类型: .rar金币: 1下载: 0 次发布日期: 2023-07-18
- 语言: Html/CSS
- 标签: HttpHelper
资源简介
HttpHelper万能框架 轻松GET、玩转POST、HTML分析、无视编码、验证码提取、Cookie分析互转、Url格式化、加密、代理IP、证书、Json数据分析、执行JavaScript 【HttpHelper万能框架】是什么? 大家好我是苏飞 , 我的HttpHelper类相信很多人都用过, HttpHelper可以非常方便的实现Http协议的GET和POST请求、自动识 别编码、无视证书、优化Cookie、可以很方便的进行web资源范围
仅供学习参考,使用后24内请删除
代码片段和文件信息
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);
}
///
/// 快速请求方
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 21177 2018-07-02 14:14 CsharpHttpHelper\ba
....... 2731 2017-07-04 11:14 CsharpHttpHelper\ba
....... 3855 2018-05-04 16:40 CsharpHttpHelper\CsharpHttpHelper.csproj
....... 458 2017-07-04 11:14 CsharpHttpHelper\Enum\AType.cs
....... 747 2017-07-04 11:14 CsharpHttpHelper\Enum\PostDataType.cs
....... 678 2017-07-04 11:14 CsharpHttpHelper\Enum\ResultCookieType.cs
....... 703 2017-07-04 11:14 CsharpHttpHelper\Enum\ResultType.cs
....... 1516 2018-04-08 17:23 CsharpHttpHelper\Helper\ba
....... 1179 2017-07-04 11:14 CsharpHttpHelper\Helper\EncodingHelper.cs
....... 2081 2017-07-04 11:14 CsharpHttpHelper\Helper\ExecJsHelper.cs
....... 5678 2017-07-04 11:14 CsharpHttpHelper\Helper\HtmlHelper.cs
....... 5447 2017-07-04 11:14 CsharpHttpHelper\Helper\HttpCookieHelper.cs
....... 4147 2017-07-04 11:14 CsharpHttpHelper\Helper\HttpUrlHelper.cs
....... 723 2017-07-04 11:14 CsharpHttpHelper\Helper\ImageHelper.cs
....... 1470 2017-07-04 11:14 CsharpHttpHelper\Helper\Json
....... 1340 2018-04-28 17:10 CsharpHttpHelper\Helper\MD5Helper.cs
....... 14006 2018-07-02 14:17 CsharpHttpHelper\HttpHelper.cs
....... 11759 2018-03-12 13:45 CsharpHttpHelper\HttpItem.cs
....... 2877 2018-07-02 14:10 CsharpHttpHelper\HttpResult.cs
....... 923 2017-07-04 11:14 CsharpHttpHelper\Item\AItem.cs
....... 499 2017-07-04 11:14 CsharpHttpHelper\Item\ImgItem.cs
....... 1458 2018-07-02 14:17 CsharpHttpHelper\Properties\AssemblyInfo.cs
....... 1906 2017-07-04 11:14 CsharpHttpHelper\Static\RegexString.cs
....... 9942 2017-07-04 11:14 CsharpHttpHelper_Demo\CsharpHttpHelper_Demo.csproj
....... 480 2017-07-04 11:14 CsharpHttpHelper_Demo\HttpCertificate_Demo.aspx
....... 2219 2017-07-04 11:14 CsharpHttpHelper_Demo\HttpCertificate_Demo.aspx.cs
....... 819 2017-07-04 11:14 CsharpHttpHelper_Demo\HttpCertificate_Demo.aspx.designer.cs
....... 490 2017-07-04 11:14 CsharpHttpHelper_Demo\HttpCookieCollection_Demo.aspx
....... 1824 2017-07-04 11:14 CsharpHttpHelper_Demo\HttpCookieCollection_Demo.aspx.cs
....... 824 2017-07-04 11:14 CsharpHttpHelper_Demo\HttpCookieCollection_Demo.aspx.designer.cs
............此处省略62个文件信息
评论
共有 条评论