Esempio n. 1
0
        void GenerateLicenseStrings()
        {
            int currentSerialNumber = (int)startingSerialNumber.Value;

            licenseStrings = new string[(int)serialNumberCount.Value];
            for (int i = 0; i < serialNumberCount.Value; i++)
            {
                licX.LicenseKey licenseKey = new licX.LicenseKey();
                if (evaluationButton.Checked)
                {
                    licenseKey.Type                   = licX.LicenseKeyType.DesignTimeEvaluation;
                    licenseKey.EvaluationDays         = (int)evaluationDays.Value;
                    licenseKey.AbsoluteExpirationDate = false;
                }
                else
                {
                    licenseKey.Type           = licX.LicenseKeyType.DesignTimeRetail;
                    licenseKey.EvaluationDays = 0;
                    if (expiresCheckBox.Checked == true)
                    {
                        licenseKey.Type2                  = licX.LicenseKeyType.DesignTimeRetail;
                        licenseKey.Type                   = licX.LicenseKeyType.Version2;
                        licenseKey.Version                = 2;
                        licenseKey.ExpirationDate         = dateTimePicker.Value;
                        licenseKey.AbsoluteExpirationDate = true;
                    }
                }

                licenseKey.SerialNumber = currentSerialNumber;
                licenseKey.Hash         = licenseKey.CalculateHash(passwordTextBox.Text);

                licenseStrings[i] = licenseKey.ToString();

                currentSerialNumber++;
            }
        }
Esempio n. 2
0
		void GenerateLicenseStrings()
		{   
			int currentSerialNumber = (int)startingSerialNumber.Value;

			licenseStrings = new string[(int)serialNumberCount.Value];
			for(int i=0;i<serialNumberCount.Value;i++)
			{
				licX.LicenseKey licenseKey = new licX.LicenseKey();
				if ( evaluationButton.Checked )
				{
					licenseKey.Type = licX.LicenseKeyType.DesignTimeEvaluation;
					licenseKey.EvaluationDays = (int)evaluationDays.Value;
                    licenseKey.AbsoluteExpirationDate = false;
				}
				else
				{
					licenseKey.Type = licX.LicenseKeyType.DesignTimeRetail;
					licenseKey.EvaluationDays = 0;
                    if ( expiresCheckBox.Checked == true )
                    {
                        licenseKey.Type2 = licX.LicenseKeyType.DesignTimeRetail;
                        licenseKey.Type = licX.LicenseKeyType.Version2;
                        licenseKey.Version = 2;
                        licenseKey.ExpirationDate = dateTimePicker.Value;
                        licenseKey.AbsoluteExpirationDate = true;
                    }
				}
				
				licenseKey.SerialNumber = currentSerialNumber;
				licenseKey.Hash = licenseKey.CalculateHash( passwordTextBox.Text );

				licenseStrings[i] = licenseKey.ToString();

				currentSerialNumber++;
			}
		}