|
本帖最后由 缒忆 于 2013-1-14 00:47 编辑
private void KnSkysl()
{
Debug.Print(";;");
string KnSkyCotent, sid, ruin, nr;
int Listindex, Listindex1;
string lsid = this.textBox2.Text;
while (KnSkyStop != 0)
{
CookieContainer KnSkyCoo = new CookieContainer();
lock (KnSkyObject)
{
if (KnSkyIndex2 + 1 < this.listView1.Items.Count)
{
Listindex = KnSkyIndex;
KnSkyIndex++;
sid = this.listView1.Items[Listindex].SubItems[1].Text;
ruin = this.listView1.Items[Listindex].SubItems[2].Text;
}
else
{
KnSkyIndex = 0;
Listindex = KnSkyIndex;
sid = this.listView1.Items[Listindex].SubItems[1].Text;
ruin = this.listView1.Items[Listindex].SubItems[2].Text;
}
if (KnSkyIndex1 + 1 < this.listBox1.Items.Count)
{
Listindex1 = KnSkyIndex1;
KnSkyIndex1++;
nr = Convert.ToString(this.listBox1.Items[Listindex1]);
}
else
{
KnSkyIndex1 = 0;
Listindex1 = KnSkyIndex1;
nr = Convert.ToString(this.listBox1.Items[Listindex1]);
}
}
Debug.Print(sid, ruin, nr);
KnSkyCotent = XGmk.XGmkHttpPOST("http://chat.3g.qq.com/chatroom/talk.jsp?sid=" + sid + "&roomId=" + lsid, "msg=" + nr + "&talkType=1&ruin=" + ruin + "&recId=77866491", KnSkyIP, KnSkyCoo, 50000);
if (this.checkBox1.Checked == true)
{
KnSkyCotent = Regex.Replace(KnSkyCotent, Environment.NewLine, "");
KnSkyCotent = Regex.Replace(KnSkyCotent, "</p>", Environment.NewLine);
KnSkyCotent = Regex.Replace(KnSkyCotent, "<br/>", Environment.NewLine);
KnSkyCotent = Regex.Replace(KnSkyCotent, "</title>([\\S\\s]*)<body>", "");
this.textBox1.Text = Regex.Replace(KnSkyCotent, "<(.|\n)+?>", "");
}
this.groupBox3.Text = "正在第" + Convert.ToString(Listindex) + "发言。。。";
}
}
写了个多线程POST提交的程序。可是使用到这个功能时程序就跑不起来了,小弟请教一下各位,马麻烦指点迷津,帮忙看看是哪错了
|
|