//
Irrigation begins
Using
System;
Using
System.IO;
Using
System.net;
Using
System.collections.Specialized;
Using
System.Text;
Namespace
sina1
...
{/ ** //// /// Summary Description for class1. /// Class Class1 ... {/ ** //// ////// [stathread] static Void main (string [] args) ... {// Test3 (); // Return; //// Test1 (); // return; WebClient ClubindexRequest = new WebClient (); ClubindexRequest.Headers.add ("User -Agent "," Mozilla / 4.0 (compatible; msie 6.0; Windows NT 5.1; .NET CLR 1.1.4322) "); ClubindexRequest.Headers.Add (" Accept "," * / *) "); stream stream = clubindexRequest .OpenRead ( "http://house.sina.com.cn/allclub/index.html"); StreamReader reader = new StreamReader (stream); String clubIndexResponse = reader.ReadToEnd (); String url = "href = http: //comment.sina.com.cn/cgi-bin/comment/comment.cgi "; int POS1 = 0; INT POS2 = 0; string username = system.web.httputility.urlencode (" protest Panasonic Water Heater ", Encoding. GetEncoding ("GB2312"); String Rawcontent = "Horror Puff _ under Water Header / R / N I didn't want to buy a small _ Japan's things, but the wife is the Lord, bought a loose _ under the gas water heater, spent 1 More than 8,000 oceans / R / N did not expect to install it, I also received 522 yuan, 522 yuan! / R / n hit the complaint today, actually said more than 8 more! / R / N Dear owners, buy pine _ be careful when the water heater is, maybe I am like this. / r / n I can provide evidence.
"; String content = system.web.httputility.URLENCODE (" GB2312 "); while ((POS1 = ClubindexResponse.indexof (URL, POS2))> = 0) ... {// analysis Owners Forum POS1 = URL.LENGTH 1; POS2 = ClubindexResponse.indexof ("", POS1); String Clubstr = ClubindexResponse.Substring (POS1, POS2 - POS1); / / Premier (Sina's anti-irradiation measures) // create a post data String postStr = clubStr; postStr = postStr "& top_title ="; postStr = postStr "& top_url ="; postStr = postStr "& user =" userName; postStr = postStr "& password =" password; postStr = postStr "& content =" content; postStr = postStr "& temp_content =" content; byte [] postData = Encoding.ASCII.GetBytes (postStr); WebClient command = new WebClient (); command.Headers.Add ( "Content -Type "," Application / X-WWW-FORM-URLENCODED "); Command.Headers.Add (" User-Agent "," Mozilla / 4.0 (Compatible; Msie 6.0; Windows NT 5.1; .NET CLR 1.1.4322) "); Command.Headers.Add (" accept "," * / *) "); try ... {byte [] returndata = command.uploaddata ("http://comment.sina.com.cn/cgi-bin/comment/comment_do.ci", "post", postdata); string cookie = command.responseheaders ["set-cookie" ["SET-COOKIE "]; String returnstr = encoding.getencoding (" GB2312 "). GetString (Returndata); // Re-analysis, submit (Sina's anti-irrigation measures) String TimetagIndex =" ", POS3); String Timetag = returbtr.substring POS3, POS4 - POS3);
String datetimeIndex = "", pos3); String dateTime = returnStr.Substring (pos3, pos4 - pos3); dateTime = System.Web.HttpUtility.UrlEncode (dateTime, Encoding.GetEncoding ( "GB2312")); String doCommentPostStr = "hidecnt = 1 "; doCommentPostStr = doCommentPostStr " & " clubStr; doCommentPostStr = doCommentPostStr " & page = 0 "; doCommentPostStr = doCommentPostStr " & top_title = "; doCommentPostStr = doCommentPostStr " & top_url = "; doCommentPostStr = doCommentPostStr " & timetag = " timeTag; doCommentPostStr = doCommentPostStr "& datetime0 =" dateTime; doCommentPostStr = doCommentPostStr "& uid0 =" userName; doCommentPostStr = doCommentPostStr "& content0 =" content; postData = Encoding.ASCII.GetBytes (doCommentPostStr); command.Headers .Add ("Content-Type", "Application / X-WWW-Form-Urlencoded"); Command.Headers.Add ("User-Agent", "Mozilla / 4.0 (Compatible; Msie 6.0; Windows NT 5.1; .NET) CLR 1.1.4322) ")"); Comm And.headers.add ("accept", "* / *)"); command.headers.add ("referer", "http://comment.sina.com.cn/cgi-bin/comment/comment_do.cgi "); Command.Headers.Add (" cookie ", cookie); returndata = command.uploadData (" http://comment.sina.com.cn/cgi-bin/comment/comment.cgi "," post ", PostData); Returnstr = Encoding.Getencoding ("GB2312"). getString (Returndata);
System.Console.writeline ("/ r / n ************************************************"); System. Console.Writeline (Clubstr); System.Console.writeline ("******************************************************") } // IF (POS3> = 0)} // if (POS3> = 0) Else ... {system.console.writeline ("/ r / n ********************* ** received errors **************** "); system.console.writeLine (Returnstr); system.console.writeLine (" ******** ******* Access to errors **************** ");}}} catCH (Exception E) ... {system.console.writeline (" / R / n ************** Send exception ***************** "); System.Console.writeline (E.MESSAGE); System.console.writeline ("***********************************************************************");} system.threading.thread .Sleep (10 * 1000);}}}}