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");
}
c# 模拟用户登录
最新推荐文章于 2021-06-09 22:32:56 发布