|
楼主 |
发表于 2014-7-17 16:43:24
|
显示全部楼层
HttpItem item = new HttpItem()
{
URL = "http://www.baidu.com/",
Method = "get"
};
HttpHelper http = new HttpHelper();
HttpResult result = http.GetHtml(item);
StreamWriter sw = new StreamWriter(@"D:\0.txt");
sw.Write(result.Html);
sw.Close();
是这个意思吗?打开保存的文件后,有点乱:
(先在百度首页试了一下,如果是保存这样的文件的话,我再登录kename那个首页保存一下看看)
<!DOCTYPE html><!--STATUS OK--><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><link rel="dns-prefetch" href="//s1.bdstatic.com"/><link rel="dns-prefetch" href="//t1.baidu.com"/><link rel="dns-prefetch" href="//t2.baidu.com"/><link rel="dns-prefetch" href="//t3.baidu.com"/><link rel="dns-prefetch" href="//t10.baidu.com"/><link rel="dns-prefetch" href="//t11.baidu.com"/><link rel="dns-prefetch" href="//t12.baidu.com"/><title>百度一下,你就知道</title><style index="index" >html,body{height:100%}html{overflow-y:auto}#wrapper{position:relative;_position:;min-height:100%}#content{padding-bottom:100px;text-align:center}#ftCon |
|