[C#] 纯文本查看 复制代码 WebHeaderCollection header = new WebHeaderCollection();
header.Add("Accept-Encoding", "gzip, deflate, br");
header.Add("Accept-Language", "zh-CN,zh;q=0.9");
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "https://www.bet-mart.com",
Method = "GET",
Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.82 Safari/537.36",
ContentType = "text/html",
CookieContainer = new CookieContainer(),
Header = header,
SecurityProtocol = SecurityProtocolType.Tls12,
ClentCertificates = new X509CertificateCollection(),
KeepAlive = true,
Encoding = Encoding.GetEncoding("utf-8"),
IsUpdateCookie = true,
ResultType = CsharpHttpHelper.Enum.ResultType.String,
CerPath = "d:\\123.cer"
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
MessageBox.Show(html);
|