本帖最后由 风向标 于 2014-5-16 08:29 编辑
[C#] 纯文本查看 复制代码 using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using System.Data;
using System.Text;
using DotNet4.Utilities;
using System.Text.RegularExpressions;
using System.Web;
namespace httptest2
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
void Button1Click(object sender, EventArgs e)
{
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://www.sufeinet.com", //URL 必需项
Encoding = Encoding.Default, //编码格式(utf-8,gb2312,gbk) 可选项 默认类会自动识别
Method = "get", //URL 可选项 默认为get
ResultType = ResultType.String, //返回数据类型,是Byte还是String
};
HttpResult result = http.GetHtml(item); //得到HTML代码
string html = result.Html; //返回的Html内容
MessageBox.Show(html);
}
}
}
求老大解救,我用的.net4的版本
嘿嘿,下载了最新版的类,问题解决了,感谢老大
|