【发布时间】:2018-04-05 13:30:15
【问题描述】:
所以这看起来很混乱 但我基本上有一个类似的文件
username:password
username1:password4
username14:password114
现在我也有一个看起来像这样的函数/void
public static void Login(string user, string pass)
现在 void 所做的就是发出一个 httprequest 并获得它的返回,
if (reqCookie.Equals("Error1"))
{
//whenever the login credentials are false
}
else if (reqCookie.Equals("proxy"))
{
//Whenever a captcha error get's returned it sets a proxy here
}
else
{
//Whenever the request is successfull
}
我试过了:
foreach (var line in AccountList)
{
new Task(() => {
Console.WriteLine("LINE = " + accountline);
string tocheck = AccountList[accountline];
username = tocheck.Split(':')[0];
password = tocheck.Split(':')[1];
Login(username, password);
accountline++;
}).Start();
}
但问题在于它一直在悲伤地检查同一个帐户
你们知道有什么解决办法吗?
【问题讨论】:
-
你为什么用
AccountList[accountline]而不是line? -
@TheGeneral 这不是很有帮助。 KirriDev,注意 acountline++ 发生在任务中!
-
@TheGeneral 我正在尝试为某些游戏制作每日自动登录功能,不包括暴力破解
-
tocheck.Split(':')可以提取到局部变量中,以获得更高的性能 -
@FrankM 谢谢,我会把它放在一条线上,但这不是我要在这里解决的基本问题:(
标签: c# multithreading indexing