forked from Alkazuz/AdvancedBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AccountChecker.cs
109 lines (101 loc) · 3.92 KB
/
AccountChecker.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
using System;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using AdvancedBot.client;
namespace AdvancedBot
{
public partial class AccountChecker : Form
{
public AccountChecker()
{
InitializeComponent();
listView1.SetExplorerTheme();
}
private void btnStart_Click(object sender, EventArgs e)
{
if (string.IsNullOrWhiteSpace(richTextBox1.Text))
{
MessageBox.Show("Você precisa adicionar pelo menos uma conta", "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
listView1.Items.Clear();
new Thread(() =>
{
btnStart.Enabled = false;
richTextBox1.Enabled = false;
ProxyList pl = Program.FrmMain.Proxies;
foreach (String acc in richTextBox1.Lines)
{
String email = "";
String pass = "";
if (acc.Contains(":")) {
email = acc.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries)[0];
pass = acc.Split(new char[] { ':' }, StringSplitOptions.RemoveEmptyEntries)[1];
} else {
continue;
}
try
{
Proxy proxy = pl.NextProxy();
LoginResponse login = SessionUtils.Login(email, pass, proxy);
if (login.Error) {
var listViewItem = new ListViewItem(acc);
listViewItem.SubItems.Add("Fail");
listView1.Items.Add(listViewItem);
} else {
var listViewItem = new ListViewItem(acc);
listViewItem.SubItems.Add("OK");
listView1.Items.Add(listViewItem);
}
int size = getRichSize();
percentageProgressBar1.Value = (100 * listView1.Items.Count) / size;
Thread.Sleep(2000);
}
catch (Exception)
{
var listViewItem = new ListViewItem(acc);
listViewItem.SubItems.Add("Fail");
listView1.Items.Add(listViewItem);
}
Thread.Sleep(1000);
}
btnStart.Enabled = true;
richTextBox1.Enabled = true;
}).Start();
}
public int getRichSize()
{
int i = 0;
foreach (String acc in richTextBox1.Lines) {
if (acc.Contains(":"))
i++;
}
return i;
}
private void AccountChecker_Load(object sender, EventArgs e)
{
percentageProgressBar1.Show();
listView1.ContextMenuStrip = contextMenuStrip1;
Icon = Program.FrmMain.Icon;
}
private void copiarFuncionandoToolStripMenuItem_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
foreach (ListViewItem item in listView1.Items) {
if(item.SubItems[1].Text.EqualsIgnoreCase("OK"))
sb.AppendLine(item.Text);
}
Clipboard.SetDataObject(sb.ToString(), true);
}
private void copiarOfflinesToolStripMenuItem_Click(object sender, EventArgs e)
{
StringBuilder sb = new StringBuilder();
foreach (ListViewItem item in listView1.Items) {
if (item.SubItems[1].Text.EqualsIgnoreCase("Fail"))
sb.AppendLine(item.Text);
}
Clipboard.SetDataObject(sb.ToString(), true);
}
}
}