Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Net.NetworkInformation;
- using System.Text;
- using System.Threading.Tasks;
- namespace Rocket
- {
- class CheckerLicense
- {
- public static void License()
- {
- /// #############################
- // ## Licença Rocket System ##
- // #############################
- Console.ForegroundColor = ConsoleColor.White;
- bool podeIniciar = false;
- string webData = "";
- WebClient wc = new WebClient();
- try
- {
- Console.ForegroundColor = ConsoleColor.White;
- webData = wc.DownloadString("http://rocketnetworks.host/rocket-license.txt");
- }
- catch (ArgumentNullException e)
- {
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Erro #1: " + e.Message);
- Console.ReadKey();
- Environment.Exit(1);
- }
- catch (WebException e)
- {
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Erro #2: " + e.Message);
- Console.ReadKey();
- Environment.Exit(1);
- }
- catch (NotSupportedException e)
- {
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine("Erro #3: " + e.Message);
- Console.ReadKey();
- Environment.Exit(1);
- }
- if (
- File.ReadAllText(Environment.SystemDirectory + "\\drivers\\etc\\hosts")
- .ToLower()
- .Contains("rocketnetworks.host"))
- {
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => O seu arquivo 'host' já tem 'RocketEmulador.ml' remova-o.");
- Console.ReadKey();
- Environment.Exit(1);
- }
- else
- {
- var macs = webData.Split(';');
- var macAdrress = (from nic in NetworkInterface.GetAllNetworkInterfaces()
- where nic.OperationalStatus == OperationalStatus.Up
- select nic.GetPhysicalAddress().ToString()
- ).FirstOrDefault();
- // Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => Sua licença foi aceita, aproveite o emulador.");
- // Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => Lembre-se de pagar sua licença em dia, para evitar futuros problemas.");
- foreach (var macAtual in macs)
- {
- if (macAtual == macAdrress.ToString())
- podeIniciar = true;
- }
- if (podeIniciar == true)
- {
- Console.ForegroundColor = ConsoleColor.White;
- Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => Não conseguimos encontrar sua licença, entre em contato por favor.");
- Console.WriteLine(" [CARREGANDO] => [Rocket Licença] => Possivelmente sua licença está atrasada, por favor pague sua licença.");
- Console.ReadKey();
- Environment.Exit(1);
- }
- }
- // #############################
- // ## Licença Rocket System ##
- // #############################*/
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement