/// <summary> /// Write an account to queue to be flushed and written to file later /// </summary> /// <param name="account">Account to log</param> public void Write(Config.Account account) { /*Write notice*/ Console.WriteLine("Found account: {0}", account.username); /*Add account to queue*/ string logMessage = string.Format("{0}\n{1}\n{2}\n", account.username, account.email, account.steamid); logQueue.Add(logMessage); FlushLog(); }
/// <summary> /// Parses the response from query /// </summary> /// <param name="o">Sender</param> /// <param name="e">EventArgs - we get page source from result</param> private void ParseResponse(object o, DownloadStringCompletedEventArgs e, string steamId) { try { string pageSource = e.Result; if (pageSource.Contains("This user has not yet set up their Steam Community profile.")) { /*Get the account name from page title*/ string accountName = Functions.GetStringBetween(pageSource, "<title>", "</title>") .Replace("Steam Community :: ", ""); if (!string.IsNullOrEmpty(accountName) && accountName.Length >= 3) { /*Format email and check if it looks okay*/ string accountEmail = string.Format("{0}@hotmail.com", accountName); /*If the email is valid and not taken*/ if (IsEmailGood(accountEmail)) { /*Set up the account*/ var account = new Config.Account() { steamid = steamId, username = accountName, email = accountEmail }; mLog.Write(account); mAccountsFound++; } } } } catch (Exception ex) { Console.WriteLine("Exception: {0}", ex.Message); } /*Release queue position*/ mSem.Release(); }
/// <summary> /// Parses the response from query /// </summary> /// <param name="o">Sender</param> /// <param name="e">EventArgs - we get page source from result</param> private void ParseResponse(object o, DownloadStringCompletedEventArgs e, string steamId) { try { string pageSource = e.Result; if (pageSource.Contains("This user has not yet set up their Steam Community profile.")) { /*Get the account name from page title*/ string accountName = Functions.GetStringBetween(pageSource, "<title>", "</title>") .Replace("Steam Community :: ", ""); if (!string.IsNullOrEmpty(accountName) && accountName.Length > 5) { /*Format email and check if it looks okay*/ string accountEmail = string.Format("{0}@hotmail.com", accountName); /*If the email is valid and not taken*/ if (IsEmailGood(accountEmail)) { /*Set up the account*/ var account = new Config.Account() { steamid = steamId, username = accountName, email = accountEmail }; mLog.Write(account); mAccountsFound++; } } } } catch(Exception ex) { Console.WriteLine("Exception: {0}", ex.Message); } /*Release queue position*/ mSem.Release(); }