Advertisement
AhmedSokr

Untitled

Jan 27th, 2019
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.IO;
  7. using System.Linq;
  8. using System.Net;
  9. using System.Net.NetworkInformation;
  10. using System.Text;
  11. using System.Threading.Tasks;
  12. using System.Windows.Forms;
  13.  
  14. namespace SharkMarketing
  15. {
  16. public partial class Form1 : Form
  17. {
  18. public Form1()
  19. {
  20. InitializeComponent();
  21. var fuck = CreateMD5(GetMacAddress());
  22. textBox1.Text = fuck;
  23. }
  24. public string MacAdress;
  25. private bool CheckLogin(string MacAdress)
  26. {
  27. HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://pastebin.com/tHbW3wkQ");
  28. HttpWebResponse response = (HttpWebResponse)request.GetResponse();
  29. StreamReader reader = new StreamReader(response.GetResponseStream());
  30. while (!reader.EndOfStream)
  31. {
  32. char[] separator = new char[] { '|' };
  33.  
  34. string[] strArray = reader.ReadLine().Split(separator);
  35.  
  36. if (((strArray[0] == MacAdress)))
  37. {
  38. return true;
  39. }
  40. }
  41. return false;
  42. }
  43. public static string CreateMD5(string input)
  44. {
  45. using (System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create())
  46. {
  47. byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
  48. byte[] hashBytes = md5.ComputeHash(inputBytes);
  49. StringBuilder sb = new StringBuilder();
  50. for (int i = 0; i < hashBytes.Length; i++)
  51. {
  52. sb.Append(hashBytes[i].ToString("X2"));
  53. }
  54. return sb.ToString();
  55. }
  56. }
  57.  
  58.  
  59. private static string GetMacAddress()
  60. {
  61. string macAddresses = string.Empty;
  62.  
  63. foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
  64. {
  65. if (nic.OperationalStatus == OperationalStatus.Up)
  66. {
  67. macAddresses += nic.GetPhysicalAddress().ToString();
  68. break;
  69. }
  70. }
  71.  
  72. return macAddresses;
  73. }
  74.  
  75. private void button3_Click(object sender, EventArgs e)
  76. {
  77.  
  78. }
  79.  
  80. private void textBox1_TextChanged(object sender, EventArgs e)
  81. {
  82. }
  83.  
  84. private void button2_Click(object sender, EventArgs e)
  85. {
  86. bool flag = this.CheckLogin(MacAdress);
  87. if (flag)
  88. {
  89. if (flag)
  90. {
  91. MessageBox.Show("Welcome To SharkMarketing");
  92. MyProgram mProgram = new MyProgram(); // Instantiate a Form3 object.
  93. mProgram.Show(); // Show Form3 and
  94.  
  95.  
  96. base.Hide();
  97. }
  98. }
  99. else
  100. {
  101. MessageBox.Show("Login Failed");
  102. }
  103.  
  104.  
  105. }
  106. }
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement