예제 #1
0
 private void đăngKýToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (frmRegistration frm = new frmRegistration())
     {
         frm.ShowDialog();
     }
 }
예제 #2
0
        public frmMain()
        {
            InitializeComponent();

            //kiem tra license
            KeyManager  km         = new KeyManager(ComputerInfo.GetComputerId());
            LicenseInfo lic        = new LicenseInfo();
            int         value      = km.LoadSuretyFile(string.Format(@"{0}\Key.lic", Application.StartupPath), ref lic);
            string      productKey = lic.ProductKey;
            bool        isActive   = false;//bien kiem tra kich hoat

            if (km.ValidKey(ref productKey))
            {
                KeyValuesClass kv = new KeyValuesClass();
                if (km.DisassembleKey(productKey, ref kv))
                {
                    if (kv.Type == LicenseType.TRIAL)
                    {
                        //dung thu ma con ngay thi cho chay
                        if ((kv.Expiration - DateTime.Now.Date).Days > 0)
                        {
                            isActive = true;
                        }
                    }
                    else
                    {
                        isActive = true;
                    }
                }
            }

            if (isActive)
            {
                //da kich hoat thi load url camera
                LoadUrlCamera();
            }
            else
            {
                using (frmRegistration frm = new frmRegistration())
                {
                    frm.ShowDialog();
                }
            }
        }