C#代码错误,马上哪位高手帮我看看哪里表达错误了
publicvoidQzoneBw_DoWork(objectsender,System.ComponentModel.DoWorkEventArgse){if(((Co...
public void QzoneBw_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
{
if (((Commands) (e.Argument[0])) == Commands.GetUserList)
{
string src = GethtmlCode("http://r.qzone.qq.com/cgi-bin/tfriend/friend_show_qqfriends.cgi?uin=" + System.Convert.ToString(e.Argument[1]) + "&follow_flag=0&groupface_flag=0&fupdate=1&g_tk=" + Skey);
System.Xml.XmlDocument xml = GetXml(DeJson(src.Replace("_Callback", null)));
QUserList userlist = new QUserList() {Uid = uid};
foreach (XmlNode i in xml.SelectNodes("/root/data/gpnames"))
{
userlist.Groups.Add(i.SelectSingleNode("gpid").InnerText, new Group() {xml.Name = i.SelectSingleNode("gpname").InnerText,
xml.GroupId = i.SelectSingleNode("gpid").InnerText});
}
foreach (XmlNode i in xml.SelectNodes("/root/data/items"))
{
userlist.Groups[i.SelectSingleNode("groupid").InnerText].Users.Add(
new User() xml.GroupId = i.SelectSingleNode("groupid").InnerText,
xml.FaceImgUrl = i.SelectSingleNode("img").InnerText,
xml.Uid = i.SelectSingleNode("uin").InnerText,
xml.remark = i.SelectSingleNode("remark").InnerText,
xml.Yellow = i.SelectSingleNode("yellow").InnerText,
xml.Name = i.SelectSingleNode("name").InnerText});
}
e.Result = new object[] {e.Argument[0], userlist};
}
else if (((Commands) (e.Argument(0))) == Commands.AddMsg)
{
QzoneBw.ReportProgress(2, "准备开始留言...");
Random rand = new Random();
List<User> userlist = e.Argument[2];
List<string> contentlist = e.Argument[1];
foreach (User i in userlist)
{
System.Threading.Thread.Sleep(Interval);
string ret = PostDate("http://m.qzone.qq.com/cgi-bin/new/add_msgb?g_tk=" + Skey, System.Text.Encoding.Default.GetBytes(Qzone.GetMsgByte(uid, i.Uid, contentlist[rand.Next(contentlist.Count - 1)])));
QzoneBw.ReportProgress(2, "为" + GetValidQName(i) + "留言,返回:" + getinnttext(ret, "\"message\":\"", "\""));
}
e.Result = new object[] {e.Argument(0)};
}
else if (((Commands) (e.Argument(0))) == Commands.QQMsg)
{
}
} 展开
{
if (((Commands) (e.Argument[0])) == Commands.GetUserList)
{
string src = GethtmlCode("http://r.qzone.qq.com/cgi-bin/tfriend/friend_show_qqfriends.cgi?uin=" + System.Convert.ToString(e.Argument[1]) + "&follow_flag=0&groupface_flag=0&fupdate=1&g_tk=" + Skey);
System.Xml.XmlDocument xml = GetXml(DeJson(src.Replace("_Callback", null)));
QUserList userlist = new QUserList() {Uid = uid};
foreach (XmlNode i in xml.SelectNodes("/root/data/gpnames"))
{
userlist.Groups.Add(i.SelectSingleNode("gpid").InnerText, new Group() {xml.Name = i.SelectSingleNode("gpname").InnerText,
xml.GroupId = i.SelectSingleNode("gpid").InnerText});
}
foreach (XmlNode i in xml.SelectNodes("/root/data/items"))
{
userlist.Groups[i.SelectSingleNode("groupid").InnerText].Users.Add(
new User() xml.GroupId = i.SelectSingleNode("groupid").InnerText,
xml.FaceImgUrl = i.SelectSingleNode("img").InnerText,
xml.Uid = i.SelectSingleNode("uin").InnerText,
xml.remark = i.SelectSingleNode("remark").InnerText,
xml.Yellow = i.SelectSingleNode("yellow").InnerText,
xml.Name = i.SelectSingleNode("name").InnerText});
}
e.Result = new object[] {e.Argument[0], userlist};
}
else if (((Commands) (e.Argument(0))) == Commands.AddMsg)
{
QzoneBw.ReportProgress(2, "准备开始留言...");
Random rand = new Random();
List<User> userlist = e.Argument[2];
List<string> contentlist = e.Argument[1];
foreach (User i in userlist)
{
System.Threading.Thread.Sleep(Interval);
string ret = PostDate("http://m.qzone.qq.com/cgi-bin/new/add_msgb?g_tk=" + Skey, System.Text.Encoding.Default.GetBytes(Qzone.GetMsgByte(uid, i.Uid, contentlist[rand.Next(contentlist.Count - 1)])));
QzoneBw.ReportProgress(2, "为" + GetValidQName(i) + "留言,返回:" + getinnttext(ret, "\"message\":\"", "\""));
}
e.Result = new object[] {e.Argument(0)};
}
else if (((Commands) (e.Argument(0))) == Commands.QQMsg)
{
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询