Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.IO;
- using System.Diagnostics;
- using System.Web;
- using System.Threading;
- using System.Net;
- using System.Management;
- namespace PSC_Checker
- {
- public partial class Form1 : Form
- {
- int PSCnummer;
- int PSCmax;
- Thread[] checkerThread;
- public Form1()
- {
- InitializeComponent();
- PSCnummer = 0;
- PSCmax = 0;
- label1.Text = "Status:";
- checkerThread = new Thread[Convert.ToInt32(1)];
- for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
- {
- int input = i;
- checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
- checkerThread[i].Start(input);
- }
- }
- CookieContainer cookieContainer = new CookieContainer();
- private delegate void updateApplicationDel(string Status);
- private delegate string Get();
- private delegate void PSCwerthinzufügenHandler(int Index, string statsu);
- public void Captchadladen(object jjj)
- {
- try
- {
- HttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create("https://www.paysafecard.com/fileadmin/source/widgets/balancecheck/index.php");
- myRequest.CookieContainer = cookieContainer;
- myRequest.Method = "GET";
- myRequest.UserAgent = "UMozilla/5.0 (Windows NT 6.1; WOW64; rv:19.0) Gecko/19.0 Firefox/19.0";
- myRequest.ContentType = "application/x-www-form-urlencoded";
- HttpWebResponse myRes = (HttpWebResponse)myRequest.GetResponse();
- StreamReader srs = new StreamReader(myRes.GetResponseStream());
- string html = srs.ReadToEnd();
- html = System.Text.RegularExpressions.Regex.Replace(html, @"""", string.Empty);
- Regex CaptchaURL = new Regex("(?<=id=siimage style=border: 1px solid #ccc; src=).*(?=[a-z]{0,10}[0-9]{0,10}[A-Z]{0,10}[0-9]{0,10}alt=CAPTCHA Image>)");
- myRequest = (HttpWebRequest)HttpWebRequest.Create("https://www.paysafecard.com/" + CaptchaURL.Match(html).ToString());
- myRequest.CookieContainer = cookieContainer;
- myRequest.AllowAutoRedirect = true;
- myRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20.0 Firefox/20.0";
- myRequest.KeepAlive = true;
- Stream stream = myRequest.GetResponse().GetResponseStream();
- Image img = Image.FromStream(stream);
- pictureBox1.Image = img;
- }
- catch
- {
- }
- if (textBox1.InvokeRequired)
- textBox1.Invoke(new updateApplicationDel(Captshafedlnull), "");
- else
- textBox1.Text = "";
- if (label1.InvokeRequired)
- label1.Invoke(new updateApplicationDel(label1ändern), "Status: Captscha geladen");
- else
- label1.Text = "Status: Captscha geladen";
- }
- public void label1ändern(string status)
- {
- label1.Text = status;
- }
- public void Captshafedlnull(string status)
- {
- textBox1.Text = status;
- }
- public string GetCaptcha()
- {
- return textBox1.Text;
- }
- public void PSCpürfen(object PSCro)
- {
- string ll = "";
- try
- {
- string PSC1 = PSCro.ToString();
- string Captcha = "";
- if (textBox1.InvokeRequired)
- Captcha = textBox1.Invoke(new Get(GetCaptcha)).ToString();
- else
- Captcha = GetCaptcha();
- string PSCData = "cardnumber0=" + PSC1.Split(' ')[0].ToString() + "&cardnumber1=" + PSC1.Split(' ')[1].ToString() + "&cardnumber2=" + PSC1.Split(' ')[2].ToString() + "&cardnumber3=" + PSC1.Split(' ')[3].ToString() + "&captcha=" + Captcha + "&action=2&lc=de-de";
- ASCIIEncoding encoding = new ASCIIEncoding();
- byte[] data = Encoding.UTF8.GetBytes(PSCData);
- HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("https://www.paysafecard.com/fileadmin/source/widgets/balancecheck/index.php");
- myRequest.Method = "POST";
- myRequest.CookieContainer = cookieContainer;
- myRequest.AllowAutoRedirect = true;
- myRequest.Timeout = 8000;
- myRequest.UserAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:22.0) Gecko/20130223 Firefox/22.0";
- myRequest.Referer = "https://www.paysafecard.com/de-de/guthaben-abfragen/";
- myRequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
- myRequest.KeepAlive = true;
- myRequest.ContentLength = data.Length;
- Stream newStream = myRequest.GetRequestStream();
- newStream.Write(data, 0, data.Length);
- newStream.Close();
- HttpWebResponse myRes = (HttpWebResponse)myRequest.GetResponse();
- StreamReader srs = new StreamReader(myRes.GetResponseStream());
- string html = srs.ReadToEnd();
- if (html.Contains("Guthaben deiner paysafecard:"))
- {
- Regex Url = new Regex("(?<=<h2>Guthaben deiner paysafecard: EUR ).*(?=[0-9]{0,8}</h2>)");
- ll = Url.Match(html).ToString();
- if (listView1.InvokeRequired)
- listView1.Invoke(new PSCwerthinzufügenHandler(PSCwerthinzufügen), PSCnummer, Url.Match(html).ToString());
- else
- PSCwerthinzufügen(PSCnummer, Url.Match(html).ToString());
- PSCnummer++;
- checkerThread = new Thread[Convert.ToInt32(1)];
- for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
- {
- int input = i;
- checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
- checkerThread[i].Start(input);
- }
- }
- else if (html.Contains("Das gesamte Guthaben steht dir noch zur Verfügung."))
- {
- if (listView1.InvokeRequired)
- listView1.Invoke(new PSCwerthinzufügenHandler(PSCwerthinzufügen), PSCnummer, "Voll");
- else
- PSCwerthinzufügen(PSCnummer, "Voll");
- PSCnummer++;
- checkerThread = new Thread[Convert.ToInt32(1)];
- for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
- {
- int input = i;
- checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
- checkerThread[i].Start(input);
- }
- }
- else
- {
- if (html.Contains("Die eingegebene Zahlenkombination stimmt nicht mit dem Captcha überein. Versuche es nocheinmal."))
- {
- MessageBox.Show("Die eingegebene Zahlenkombination stimmt nicht mit dem Captcha überein. Versuche es nocheinmal.");
- checkerThread = new Thread[Convert.ToInt32(1)];
- for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
- {
- int input = i;
- checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
- checkerThread[i].Start(input);
- }
- if (PSCnummer >= 2)
- {
- PSCnummer--;
- }
- else
- {
- PSCnummer = 0;
- }
- }
- else
- {
- if (listView1.InvokeRequired)
- listView1.Invoke(new PSCwerthinzufügenHandler(PSCwerthinzufügen), PSCnummer, "Ungültig");
- else
- PSCwerthinzufügen(PSCnummer, "Ungültig");
- PSCnummer++;
- checkerThread = new Thread[Convert.ToInt32(1)];
- for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
- {
- int input = i;
- checkerThread[i] = new Thread(new ParameterizedThreadStart(Captchadladen));
- checkerThread[i].Start(input);
- }
- }
- if (label1.InvokeRequired)
- label1.Invoke(new updateApplicationDel(label1ändern), "Status: PSC gecheckt");
- else
- label1.Text = "Status: PSC gecheckt";
- }
- }
- catch(Exception ex)
- {
- MessageBox.Show(ex.ToString());
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- if (PSCnummer < PSCmax)
- {
- checkerThread = new Thread[Convert.ToInt32(1)];
- for (int i = 0; i <= Convert.ToInt32(1) - 1; i++)
- {
- string PSC = listView1.Items[PSCnummer].SubItems[0].Text.ToString();
- checkerThread[i] = new Thread(new ParameterizedThreadStart(PSCpürfen));
- checkerThread[i].Start(PSC);
- }
- }
- else
- {
- MessageBox.Show("Alle PSC Codes gecheckt");
- if (label1.InvokeRequired)
- label1.Invoke(new updateApplicationDel(label1ändern), "Status: Alle PSC Codes gecheckt");
- else
- label1.Text = "Status: Alle PSC Codes gecheckt";
- }
- }
- catch
- {
- }
- }
- void PSCwerthinzufügen(int index, string statsu)
- {
- try
- {
- listView1.Items[index].SubItems[1].Text = statsu;
- }
- catch
- {
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- int proxyCount;
- int line = 0;
- using (OpenFileDialog o = new OpenFileDialog())
- {
- o.Filter = "Text Files|*.txt|All Files|*.*";
- if (o.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- proxyCount = File.ReadAllLines(o.FileName).Length;
- foreach (String s in File.ReadAllLines(o.FileName))
- {
- try
- {
- Regex Url = new Regex("[0-9]{0,4}");
- StringBuilder sb = new StringBuilder();
- foreach (Match match in Url.Matches(s))
- {
- string hinzufügen = match.ToString();
- sb.Append(hinzufügen);
- }
- string l = sb.ToString();
- Regex Urls = new Regex("[0-9]{0,4}");
- StringBuilder ssb = new StringBuilder();
- foreach (Match match in Urls.Matches(l))
- {
- string hinzufügen = match.ToString();
- ssb.Append(hinzufügen + " ");
- }
- ListViewItem item1 = new ListViewItem();
- item1.Text = ssb.ToString();
- item1.SubItems.Add("");
- listView1.Items.Add(item1);
- }
- catch
- {
- line++;
- }
- line++;
- PSCmax++;
- Application.DoEvents();
- }
- }
- }
- if (label1.InvokeRequired)
- label1.Invoke(new updateApplicationDel(label1ändern), "Status: PSC von Textdatei hinzugefügt");
- else
- label1.Text = "Status: PSC von Textdatei hinzugefügt";
- }
- private void button5_Click(object sender, EventArgs e)
- {
- using (SaveFileDialog sF = new SaveFileDialog())
- {
- sF.DefaultExt = "txt";
- sF.Filter = "Text Files|*.txt|All Files|*.*";
- if (sF.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- int TwitterSave = listView1.Items.Count;
- if (checkBox1.Checked == true)
- {
- for (int i = 0; i <= TwitterSave; i++)
- {
- try
- {
- StreamWriter myFile = new StreamWriter(sF.FileName, true);
- myFile.Write(listView1.Items[i].SubItems[0].Text.ToString() + " Wert = " + listView1.Items[i].SubItems[1].Text.ToString() + " €" + "\r\n");
- myFile.Close();
- }
- catch (Exception exc)
- {
- string fehler = exc.ToString();
- }
- }
- }
- else
- {
- for (int i = 0; i <= TwitterSave; i++)
- {
- try
- {
- StreamWriter myFile = new StreamWriter(sF.FileName, true);
- myFile.Write(listView1.Items[i].SubItems[0].Text.ToString() + "\r\n");
- myFile.Close();
- }
- catch (Exception exc)
- {
- string fehler = exc.ToString();
- }
- }
- }
- }
- }
- if (label1.InvokeRequired)
- label1.Invoke(new updateApplicationDel(label1ändern), "Status: PSC gespeichert");
- else
- label1.Text = "Status: PSC gespeichert";
- Application.DoEvents();
- }
- private bool pruefeEingabe(string tmp)
- {
- string pat = "0123456789 ";
- foreach (char ch in tmp)
- {
- if (pat.IndexOf(ch) < 0)
- return false;
- }
- return true;
- }
- private void button4_Click(object sender, EventArgs e)
- {
- if (textBox2.Text != " ")
- {
- if (textBox2.Text != "")
- {
- if (pruefeEingabe(textBox2.Text) == false)
- {
- MessageBox.Show("Bitte geben sie nur Zahlen ein!");
- }
- else
- {
- Regex Url = new Regex("[0-9]{0,4}");
- StringBuilder sb = new StringBuilder();
- foreach (Match match in Url.Matches(textBox2.Text))
- {
- string hinzufügen = match.ToString();
- sb.Append(hinzufügen);
- }
- string l = sb.ToString();
- Regex Urls = new Regex("[0-9]{0,4}");
- StringBuilder ssb = new StringBuilder();
- foreach (Match match in Urls.Matches(l))
- {
- string hinzufügen = match.ToString();
- ssb.Append(hinzufügen + " ");
- }
- ListViewItem item1 = new ListViewItem();
- item1.Text = ssb.ToString();
- item1.SubItems.Add("");
- listView1.Items.Add(item1);
- textBox2.Text = "";
- PSCmax++;
- if (label1.InvokeRequired)
- label1.Invoke(new updateApplicationDel(label1ändern), "Status:PSC von Textbox hinzugefügt");
- else
- label1.Text = "Status:PSC von Textbox hinzugefügt";
- }
- }
- else
- {
- MessageBox.Show("Bitte gebe sie eine PSC code ein");
- }
- }
- else
- {
- MessageBox.Show("Bitte gebe sie eine PSC code ein");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement