Ejemplo n.º 1
0
        private void button2_Click(object sender, EventArgs e)
        {
            clsLicensing.License lic = new clsLicensing.License();
            string   ErrMsg          = string.Empty;
            DateTime dtEndLicense    = new DateTime();
            string   MachineCode     = string.Empty;

            if (!lic.checklicense(tbLicCode.Text, ref ErrMsg, true, ref dtEndLicense, ref MachineCode))
            {
                MessageBox.Show("Error: " + ErrMsg, "Error reading INI", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            tbMacCode.Text  = MachineCode;
            tbEndValid.Text = dtEndLicense.ToString();
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            ListMethods = new List <clsMethods>();
            ListMethods = procAvailable.AvailableMethod();
            clsLicensing.License lic = new clsLicensing.License();
            if (!lic.CheckLicensing())
            {
                string filePath = Assembly.GetExecutingAssembly().Location;
                //if No License File, a 30 days trial will apply
                DateTime dtApplicationModDate = new FileInfo(filePath).LastWriteTime;

                if (DateTime.Now.Subtract(dtApplicationModDate).Days > 30)
                {
                    logs.WriteLogs("Application", "Your 30-days Trial starts");
                }
            }
            LoadMyMethod(ref ListMethods);
        }