C#实现自动登录网站,但是提示此流不支持查找操作.
我没有做查找操作
string name = "최양애";
// string name = "%C3%D6%BE%E7%BE%D6";
string idnb1 = "640501";
string idnb2 = "2632218";
// ASCIIEncoding encoding = new ASCIIEncoding();
// Encoding encoding = Encoding.GetEncoding("korean");
string strUrl = "https://www.d-fighter.com/POP/member/id_pass/index.php?mode=user_chk";
string postData = "mode=user_chk";
postData += ("&name=" + name + "&idnb1=" + idnb1 + "&idnb2=" + idnb2);
byte[] data = Encoding.ASCII.GetBytes(postData);
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(strUrl);
myRequest.Method = "POST";
myRequest.Headers.Add("Accept-Encoding", "gzip, deflate");
myRequest.Headers.Add("Accept-Language", "zh-cn");
myRequest.UserAgent = "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)";
myRequest.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
myRequest.Referer = "https://www.d-fighter.com/POP/member/id_pass/index.php";
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
try
{
Stream newStream = myRequest.GetRequestStream();
// Send the data.
newStream.Write(data, 0, data.Length);//这里提示此流不能做查找操作.郁闷.
newStream.Close();
}
catch
{
}