Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Net;
  6. using System.Net.NetworkInformation;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9.  
  10. namespace Rocket
  11. {
  12. class CheckerLicense
  13. {
  14.  
  15. public static void License()
  16. {
  17. /// #############################
  18. // ## Licença Rocket System ##
  19. // #############################
  20. Console.ForegroundColor = ConsoleColor.White;
  21. bool podeIniciar = false;
  22. string webData = "";
  23. WebClient wc = new WebClient();
  24. try
  25. {
  26. Console.ForegroundColor = ConsoleColor.White;
  27. webData = wc.DownloadString("http://rocketnetworks.host/rocket-license.txt");
  28. }
  29. catch (ArgumentNullException e)
  30. {
  31. Console.ForegroundColor = ConsoleColor.White;
  32. Console.WriteLine("Erro #1: " + e.Message);
  33. Console.ReadKey();
  34. Environment.Exit(1);
  35.  
  36.  
  37. }
  38. catch (WebException e)
  39. {
  40. Console.ForegroundColor = ConsoleColor.White;
  41. Console.WriteLine("Erro #2: " + e.Message);
  42. Console.ReadKey();
  43. Environment.Exit(1);
  44.  
  45. }
  46. catch (NotSupportedException e)
  47. {
  48. Console.ForegroundColor = ConsoleColor.White;
  49. Console.WriteLine("Erro #3: " + e.Message);
  50. Console.ReadKey();
  51. Environment.Exit(1);
  52. }
  53.  
  54. if (
  55. File.ReadAllText(Environment.SystemDirectory + "\\drivers\\etc\\hosts")
  56. .ToLower()
  57. .Contains("rocketnetworks.host"))
  58. {
  59. Console.ForegroundColor = ConsoleColor.White;
  60. Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => O seu arquivo 'host' já tem 'RocketEmulador.ml' remova-o.");
  61. Console.ReadKey();
  62. Environment.Exit(1);
  63. }
  64. else
  65. {
  66.  
  67. var macs = webData.Split(';');
  68. var macAdrress = (from nic in NetworkInterface.GetAllNetworkInterfaces()
  69. where nic.OperationalStatus == OperationalStatus.Up
  70. select nic.GetPhysicalAddress().ToString()
  71. ).FirstOrDefault();
  72. // Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => Sua licença foi aceita, aproveite o emulador.");
  73. // Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => Lembre-se de pagar sua licença em dia, para evitar futuros problemas.");
  74. foreach (var macAtual in macs)
  75.  
  76. {
  77. if (macAtual == macAdrress.ToString())
  78. podeIniciar = true;
  79.  
  80. }
  81.  
  82. if (podeIniciar == true)
  83. {
  84. Console.ForegroundColor = ConsoleColor.White;
  85. Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => Não conseguimos encontrar sua licença, entre em contato por favor.");
  86. Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => Possivelmente sua licença está atrasada, por favor pague sua licença.");
  87. Console.ReadKey();
  88. Environment.Exit(1);
  89. }
  90. }
  91.  
  92. // #############################
  93. // ## Licença Rocket System ##
  94. // #############################*/
  95. }
  96. }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement