The following code automatically posts to the group in cnblogs ......... note the group ID and topic ID. The group type first uses firebug to analyze the post address and parameters when posting. The headers contains cookies and copies them to d: \ cookie.txt, separated by semicolons (a = B; c = d;). These cookies contain authentication information and read the file d: \ data.txt, one post automatically sends code every 1024 bytes Using System;
Using System. Collections. Generic;
Using System. Web;
Using System. Xml;
Using System. IO;
Using System. Text;
Using System. Collections;
Using System. Net;
Using System. Threading;
Namespace Haier1
{
Class Program
{
Public static Hashtable getCookieMap ()
{
String sPath = "d: \ cookie.txt ";
Hashtable maps = new Hashtable ();
FileStream fs = new FileStream (sPath, FileMode. Open );
StreamReader rf = new StreamReader (fs, System. Text. Encoding. GetEncoding ("gb2312 "));
String hm = "";
Try
{
Do
{
Hm = rf. ReadLine ();
} While (! Rf. EndOfStream );
Console. WriteLine (hm );
String [] s1 = hm. Split (;);
// Console. Write (s1.Length );
For (int I = 0; I <s1.Length; I ++)
{
Int pos = s1 [I]. IndexOf (= );