[C#] 纯文本查看 复制代码 private void button1_Click(object sender, EventArgs e)
{
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://localhost:88/TextGuest8.6/login.php",//URL 必需项
Method = "POST",//URL 可选项 默认为Get
Postdata = "action=login&username=admin888&password=123456&time=0",
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
string cookie = result.Cookie;
if (!string.IsNullOrEmpty(cookie))
{
item = new HttpItem()
{
URL = "http://localhost:88/TextGuest8.6/index.php",//URL 必需项
Method = "get",//URL 可选项 默认为Get
Cookie = cookie//当前登录Cookie
};
//得到HTML代码
HttpResult result2 = http.GetHtml(item);
html = result2.Html;
cookie = result2.Cookie;
}
}
|