This is a security method.
Private void form1_load (Object sender, eventargs E)
{
Post P = New post ();
P. onpost + = new post. onposthandler (p_post );
T = new thread (New threadstart (P. Go ));
}
Void p_post (int m, string result)
{
If (this. textbox1.invokerequired)
{
Post. onposthandler d = new post. onposthandler (p_post );
This. Invoke (D, new object [] {M, result });
}
Else
{
This. textbox1.text = M. tostring ();
}
}
Class post
{
Public Post ()
{
}
Public Delegate void onposthandler (int m, string result );
Public event onposthandler onpost;
Private Static int COUNT = 0;
Public void go ()
{
WebClient = new WebClient ();
WebClient. headers. Add ("accept", "image/GIF, image/X-xbitmap, image/JPEG, image/pjpeg ,*/*");
WebClient. headers. Add ("Referer", "http://www.xmsell.com/zhuanti/jjworld/match_show.asp? Id = 3 ");
WebClient. headers. Add ("Accept-language", "ZH-CN ");
WebClient. headers. Add ("Content-Type", "application/X-WWW-form-urlencoded ");
WebClient. headers. Add ("Accept-encoding", "gzip, deflate ");
WebClient. headers. Add ("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; sv1 ;)");
String poststr = "grade = % Cd % B6 % CB % FB % D2 % BB % C6 % B1 % A3 % a1 % A3 % a1 % A3 % A1 & submit = + % Cd % B6 + % C6 % B1 + ";
Byte [] DATA = encoding. ASCII. getbytes (poststr );
While (true)
{
Count ++;
Byte [] responsearray = WebClient. uploaddata ("http://www.xmsell.com/zhuanti/jjworld/match_show.asp? Action = add & id = 3 "," Post ", data );
// Thread. Sleep (500 );
String responsestr = encoding. getencoding ("gb2312"). getstring (responsearray );
If (onpost! = NULL)
{
Onpost (count, responsestr );
}
}
}
}