/// <summary>
///抓取网站内容(项目需求进行更改,抓folktel字段)
/// </summary>
/// <param name="webUrl">网站地址</param>
/// <param name="cookie">cookie</param>
/// <returns></returns>
public static string GetWebSourceFile(string webUrl,string cookie)
{
WebClient webClient = new WebClient();
webClient.Headers.Add("Cookie", cookie);
webClient.Credentials = CredentialCache.DefaultCredentials;
Stream stream = webClient.OpenRead(webUrl);
StreamReader reader = new StreamReader(stream);
string content = reader.ReadToEnd();
reader.Close();
stream.Close();
return content;
}
ibcadmin 发表于 2014-10-15 16:54
参考这个试试 我之前写的抓取的
///
///抓取网站内容(项目需求进 ...
老大、、不行啊、、、 tdkgn 发表于 2014-10-16 04:44
老大、、不行啊、、、
- - 那我无能为力了...
页:
1
[2]