不做解释

string uriString = http://www.xxx.com/;
string postString = "name=xxxx&passwd=xxxx";
WebClient webClient = new WebClient();
webClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
byte[] postData = Encoding.Default.GetBytes(postString);
byte[] responseData = webClient.UploadData(uriString, "POST", postData);
string srcString = Encoding.UTF8.GetString(responseData);
if (srcString.IndexOf("xxx") > 0)
{
     Console.WriteLine("xxx");
}

 

posted on 2013-05-03 17:23  。!  阅读(191)  评论(0编辑  收藏  举报