Beispiel #1
0
        public bool validateLicense(string licenseFile, string key1, string key2, string keys)
        {
            bool validLicense = false;
            try
            {
                StreamReader sr = new StreamReader(licenseFile);

                Networking net = new Networking();
                Encryption enc = new Encryption();

                string licenseInfo = sr.ReadToEnd();

                string licenseInfoDecrypted = enc.DecryptString(licenseInfo, key1, key2);
                sr.Close();

                string[] liInfo = licenseInfoDecrypted.Split(' ');

                if (liInfo[0] == net.GetMACAddress().ToString() && validateKey(liInfo[1], keys) == true)
                {

                   validLicense = true;
                }

            }
            catch (Exception)
            {
                ;
            }

            return validLicense;
        }
Beispiel #2
0
        public bool validateLicense(string licenseFile, string key1, string key2, string keys)
        {
            bool validLicense = false;

            try
            {
                StreamReader sr = new StreamReader(licenseFile);

                Networking net = new Networking();
                Encryption enc = new Encryption();

                string licenseInfo = sr.ReadToEnd();

                string licenseInfoDecrypted = enc.DecryptString(licenseInfo, key1, key2);
                sr.Close();


                string[] liInfo = licenseInfoDecrypted.Split(' ');

                if (liInfo[0] == net.GetMACAddress().ToString() && validateKey(liInfo[1], keys) == true)
                {
                    validLicense = true;
                }
            }
            catch (Exception)
            {
                ;
            }

            return(validLicense);
        }
Beispiel #3
0
        public void createLicenseFile(string filename, string key, string key1, string key2)
        {
            Encryption enc = new Encryption();
            Networking net = new Networking();

            StreamWriter sw = new StreamWriter(filename, false);

            sw.Write(enc.EncryptString(net.GetMACAddress() + " " + key, key1, key2));

            sw.Close();
        }
Beispiel #4
0
        public void createLicenseFile(string filename, string key, string key1, string key2)
        {
            Encryption enc = new Encryption();
            Networking net = new Networking();

            StreamWriter sw = new StreamWriter(filename, false);

            sw.Write(enc.EncryptString(net.GetMACAddress() + " " + key, key1, key2));

            sw.Close();
        }