private void DoWClient()
{
//WebClient client = new WebClient();
// // 采取POST方式必须加的Header
//client.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
string URLAddress = @"http://www.xxrisk.com/blacklist/blacklist.action";//+ codeURL;
string receivePath = @"D:\Details\";
//int len = int.Parse("blacklist!getById.action?code=".Length.ToString());
//string s = codeURL.Substring(len, codeURL.Length - len).Substring(0, 15).ToString();
string postString = "currPage=40&iname=王";//这里即为传递的参数,可以用工具抓包分析,也可以自己分析,主要是form里面每一个name都要加进来
byte[] postData = Encoding.UTF8.GetBytes(postString);//编码,尤其是汉字,事先要看下抓取网页的编码方式
string url = "http://www.xxrisk.com/blacklist/blacklist.action";//地址
WebClient webClient = new WebClient();
webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");//采取POST方式必须加的header,如果改为GET方式的话就去掉这句话即可
byte[] responseData = webClient.UploadData(url, "POST", postData);//得到返回字符流
string srcString = Encoding.UTF8.GetString(responseData);//解码
// webClient.DownloadFile(URLAddress, receivePath + "qqqq.txt");
}