private void frmAbout_Load(object sender, EventArgs e) { lblProductID.Text = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(lblProductID.Text); LicenseInfo lic = new LicenseInfo(); int value = km.LoadSuretyFile(string.Format(@"key.lic", Application.StartupPath), ref lic); string productKey = lic.ProductKey; if (km.ValidKey(ref productKey)) { KeyValuesClass kv = new KeyValuesClass(); if (km.DisassembleKey(productKey, ref kv)) { lblName.Text = "Pastry Management System"; lblProductKey.Text = productKey; if (kv.Type == LicenseType.TRIAL) { lblLicenseType.Text = string.Format("{0} days", (kv.Expiration - DateTime.Now.Date).Days); } else { lblLicenseType.Text = "Full"; } } } }
private void frmAbout_Load(object sender, EventArgs e) { _lblProductId.Text = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(_lblProductId.Text); LicenseInfo lic = new LicenseInfo(); int value = km.LoadSuretyFile(string.Format(@"{0}\Key.lic", Application.StartupPath), ref lic); string productKey = lic.ProductKey; if (km.ValidKey(ref productKey)) { KeyValuesClass kv = new KeyValuesClass(); if (km.DisassembleKey(productKey, ref kv)) { //_lblProductName.Text = "Phần mềm chấm điểm"; _lblProductKey.Text = productKey; if (kv.Type == LicenseType.TRIAL) { _lblLicenseType.Text = string.Format("Bản dùng thử còn {0} ngày", (kv.Expiration - DateTime.Now.Date).Days); } else { _lblLicenseType.Text = "Bản quyền đã kích hoạt"; } } } }
private void frmRegistration_FormClosing(object sender, FormClosingEventArgs e) { KeyManager km = new KeyManager(ComputerInfo.GetComputerId()); LicenseInfo lic = new LicenseInfo(); bool isActive = false;//bien kiem tra kich hoat int value = km.LoadSuretyFile(string.Format(@"{0}\Key.lic", Application.StartupPath), ref lic); string productKey = lic.ProductKey; 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; } } } // neu khong con ngay su dung, thoat khoi chuong trinh if (!isActive) { MessageBox.Show("Vui lòng kích hoạt bản quyền để sử dụng. Xin cám ơn.", "Thông tin", MessageBoxButtons.OK, MessageBoxIcon.Information); Application.Exit(); } }
private bool IsRegistration() { string ProductId = ComputerInfo.GetComputerId(); KeyManager key = new KeyManager(ProductId); LicenseInfo lic = new LicenseInfo(); try { key.LoadSuretyFile(string.Format("Key.lic"), ref lic); if (lic.ProductKey == null) { var form = new Views.RegistrationProduct(); form.ShowDialog(); if (form.Success) { return(true); } } else { string productKey = lic.ProductKey; if (key.ValidKey(ref productKey)) { return(true); } } } catch (Exception ex) { Helpers.ShowMessage(ex.Message); } return(false); }
private void About_Load(object sender, EventArgs e) { txt_proudect.Text = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(txt_proudect.Text); LicenseInfo lc = new LicenseInfo(); int value = km.LoadSuretyFile(string.Format(@"{0}\key.lic", Application.StartupPath), ref lc); string proudectKey = lc.ProductKey; if (km.ValidKey(ref proudectKey)) { KeyValuesClass kv = new KeyValuesClass(); if (km.DisassembleKey(proudectKey, ref kv)) { txt_name.Text = "solution Company for SoftWare"; Txt_key.Text = proudectKey; if (kv.Type == LicenseType.TRIAL) { txt_Licence.Text = string.Format("{0} days", (kv.Expiration - DateTime.Now.Date).Days); } else { txt_Licence.Text = "Full"; } } } }
private void frmAbout_Load(object sender, EventArgs e) { lbProductID.Text = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(lbProductID.Text); LicenseInfo lic = new LicenseInfo(); km.LoadSuretyFile(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Key.lic", ref lic); string productKey = lic.ProductKey; if (km.ValidKey(ref productKey)) { KeyValuesClass kv = new KeyValuesClass(); if (km.DisassembleKey(productKey, ref kv)) { lbProductName.Text = "VISA"; lbProductKey.Text = productKey; if (kv.Type == LicenseType.TRIAL) { lbLicenseType.Text = string.Format("{0} days", (kv.Expiration - DateTime.Now.Date).Days); } else { lbLicenseType.Text = "Full"; } } } }
private void frmAbout_Load(object sender, EventArgs e) { lblProductID.Text = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(lblProductID.Text); LicenseInfo lic = new LicenseInfo(); //Get license information from license file int value = km.LoadSuretyFile(string.Format(@"{0}\Key.lic", Application.StartupPath), ref lic); string productKey = lic.ProductKey; //Check valid if (km.ValidKey(ref productKey)) { KeyValuesClass kv = new KeyValuesClass(); //Decrypt license key if (km.DisassembleKey(productKey, ref kv)) { lblProductName.Text = "*****@*****.**"; lblProductKey.Text = productKey; if (kv.Type == LicenseType.TRIAL) { lblLicenseType.Text = string.Format("{0} days", (kv.Expiration - DateTime.Now.Date).Days); } else { lblLicenseType.Text = "Full"; } } } }
private void FrmAbout_Load(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; txtProdutoID_.Text = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(txtProdutoID_.Text); LicenseInfo Lic = new LicenseInfo(); int value = km.LoadSuretyFile(string.Format(@"{0}\Key.Lic", Application.StartupPath), ref Lic); string produtoKey = Lic.ProductKey; if (km.ValidKey(ref produtoKey)) { KeyValuesClass kv = new KeyValuesClass(); if (km.DisassembleKey(produtoKey, ref kv)) { txtProdutoNome.Text = Lic.FullName; txtProdutoKey_.Text = produtoKey; if (kv.Type == LicenseType.TRIAL) { txtLicenceType.Text = string.Format("{0} Dias", (kv.Expiration - DateTime.Now.Date).Days); } else { txtLicenceType.Text = "FULL"; } } } } finally { Cursor = Cursors.Default; } }
static void Main() { _computerId = ComputerInfo.GetComputerId(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); BonusSkins.Register(); SkinManager.EnableFormSkins(); Application.Run(new Form1()); }
static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); //Setting.Port = 9090; //Setting.MarkSendFile = "@#$filetxt##$#@"; ///License /// string id = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(id); LicenseInfo lic = new LicenseInfo(); int value = km.LoadSuretyFile(string.Format(@"{0}\Key.lic", Application.StartupPath), ref lic); string productkey = lic.ProductKey; if (value <= 0) { Application.Run(new License()); //Application.Run(new frmClient()); } else if (value > 0) { KeyValuesClass kv = new KeyValuesClass(); if (km.DisassembleKey(productkey, ref kv)) { //lblProductname.Text = lic.FullName;//lic.ProductKey //lblProductKey.Text = lic.ProductKey; //productkey; if (kv.Type == LicenseType.TRIAL) { int day = Convert.ToInt32((kv.Expiration - DateTime.Now.Date).Days); if (day >= 0) { DialogResult dr = MessageBox.Show("Bạn còn: " + string.Format("{0} ngày ", (kv.Expiration - DateTime.Now.Date).Days) + "sử dụng phần mềm! \n Bạn có muốn nhập key để active", "active", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dr == DialogResult.Yes) { Application.Run(new License()); } Application.Run(new frmClient()); } else { MessageBox.Show("Bạn đã hết hạn dùng thử vui lòng nhập key để active!", "Active", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); Application.Run(new License()); } } else { //lblLicenceType.Text = "Full"; Application.Run(new frmClient()); } } } //Application.Run(new frmClient()); }
static void Main() { _computerId = ComputerInfo.GetComputerId(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); BonusSkins.Register(); SkinManager.EnableFormSkins(); UserLookAndFeel.Default.SetSkinStyle("DevExpress Style"); Application.Run(new Form1()); }
private void FrmRegistration_Load(object sender, EventArgs e) { textProductID.Text = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(textProductID.Text); LicenseInfo lic = new LicenseInfo(); //Get license information from license file int value = km.LoadSuretyFile(string.Format(@"{0}\Key.lic", Application.StartupPath), ref lic); string productKey = lic.ProductKey; }
private void frmRegistar_Load(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; txtProdutoID.Text = ComputerInfo.GetComputerId(); } finally { Cursor = Cursors.Default; } }
public void LicenseAbout() { string LicensePath = Application.StartupPath + "\\License.lic"; try { if (File.Exists(LicensePath)) { LicenseInfo lic = new LicenseInfo(); string ProductID = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(ProductID); int value = km.LoadSuretyFile(string.Format(@"{0}\License.lic", Application.StartupPath), ref lic); string productKey = lic.ProductKey; KeyValuesClass kv = new KeyValuesClass(); if (km.DisassembleKey(productKey, ref kv)) { if (kv.Type == LicenseType.TRIAL && (kv.Expiration - DateTime.Now.Date).Days > 0) { lblLicense.Caption = "Bản quyền: Thời gian còn " + string.Format("{0} ngày sử dụng", (kv.Expiration - DateTime.Now.Date).Days); } else { lblLicense.Caption = "Bản quyền: " + "Không giới hạn"; } if ((kv.Expiration - DateTime.Now.Date).Days == 0 && kv.Type != LicenseType.FULL) { btnDangNhap.Enabled = false; lblLicense.Caption = "Bản quyền: " + "Hết hạn"; alertControl1.Show(this, "Cảnh báo", "Bản quyền của bạn đã hết hạn, vui lòng cập nhật Key mới!"); } if ((kv.Expiration - DateTime.Now.Date).Days < 10 && (kv.Expiration - DateTime.Now.Date).Days != 0 && kv.Type != LicenseType.FULL) { alertControl1.Show(this, "Cảnh báo", "Bản quyền của bạn sắp hết hạn, vui lòng cập nhật Key mới!"); } } } else { lblLicense.Caption = "Bản quyền: Chưa đăng ký"; btnDangNhap.Enabled = false; alertControl1.Show(this, "Cảnh báo", "Bạn chưa đăng ký bản quyền. Vui lòng nhập key để tiếp tục sử dụng!"); } } catch (Exception) { btnDangNhap.Enabled = false; XtraMessageBox.Show("Lỗi bản quyền, vui lòng Key mới để tiếp tục sử dụng!"); return; } }
public LicenceModelsHelps GetLicence() { var U = ComputerInfo.GetComputerId(); KeyManager km = new KeyManager(U); LicenseInfo Lic = new LicenseInfo(); Models.Helps.LicenceModelsHelps modelsHelps = null; try { var getLicence = GetLocalDataUsert("ISoft 2019", "Licence"); int value = km.LoadSuretyFile(string.Format(@"{0}\Key.Lic", getLicence), ref Lic); string produtoKey = Lic.ProductKey; if (km.ValidKey(ref produtoKey)) { KeyValuesClass kv = new KeyValuesClass(); if (km.DisassembleKey(produtoKey, ref kv)) { modelsHelps = new LicenceModelsHelps { FullName = Lic.FullName, DataExpiration = kv.Expiration, Dias = kv.Type == LicenseType.TRIAL ? $"{(kv.Expiration - DateTime.Now.Date).Days} Dias" : "FULL", DiasSimples = (kv.Expiration - DateTime.Now.Date).Days, Key = produtoKey, KeyID = U, typelicence = kv.Type.ToString(), Year = Lic.Year, licencaNaturesa = (Models.Helps.Edition)kv.Edition, }; return(modelsHelps); } return(null); } else { return(null); } } catch (System.Exception exe) { XtraMessageBox.Show("Erro na Leitura da licença\n" + exe.Message, "Tente mais outra vez", MessageBoxButtons.OK, MessageBoxIcon.Error); } return(modelsHelps); }
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(); } } }
public void LicenKey() { KeyManager km = new KeyManager(ComputerInfo.GetComputerId()); LicenseInfo lic = new LicenseInfo(); //Get license information from license file int value = km.LoadSuretyFile(string.Format(@"{0}\active.lic", Application.StartupPath), ref lic); string productKey = lic.ProductKey; //Check valid if (km.ValidKey(ref productKey)) { KeyValuesClass kv = new KeyValuesClass(); //Decrypt license key if (km.DisassembleKey(productKey, ref kv)) { getLicenKey = productKey; } } }
public frmHome() { InitializeComponent(); this.Text = "الرئيسية"; ComputerInfoString = ComputerInfo.GetComputerId(); ProductKey = _Reg.GetProductKey(); string Decrypted = _Reg.Decrypt(ProductKey, "s3lw-3xr8-sqoy18"); if (Decrypted == ComputerInfoString) { button2.Enabled = true; button3.Enabled = true; button4.Enabled = true; button1.Visible = false; panel3.Height = button2.Height; panel3.Top = button2.Top; this.Text = "المشتركين"; frmsubdata = new FrontEnd.frmSubData(); groupBox1.Controls.Clear(); frmsubdata.TopLevel = false; groupBox1.Controls.Add(frmsubdata); frmsubdata.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; frmsubdata.Dock = DockStyle.Fill; frmsubdata.Show(); } else { button2.Enabled = false; button3.Enabled = false; button4.Enabled = false; panel3.Height = button1.Height; panel3.Top = button1.Top; this.Text = "الرئيسية"; frmReg = new FrontEnd.frmRegisteration(); groupBox1.Controls.Clear(); frmReg.TopLevel = false; groupBox1.Controls.Add(frmReg); frmReg.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; frmReg.Dock = DockStyle.Fill; frmReg.Show(); } }
private void Button_Click(object sender, RoutedEventArgs e) { try { string LisansText = txtLisansKodu.Text; string lsc = Kripto.RsaSifreCoz(LisansText); if (lsc != ComputerInfo.GetComputerId()) { MessageBox.Show("Geçersiz lisans kodu"); } else { File.WriteAllText("ls.lc", LisansText); ilk_kurulum(); MessageBox.Show("İşlem başarılı. Yazılımı tekrar çalıştırarak kullanmaya başlayabilirsiniz"); } } catch (Exception ex) { MessageBox.Show("Geçersiz lisans kodu" + ex.ToString()); } }
private void frmRegistration_Load(object sender, EventArgs e) { txtProductID.Text = ComputerInfo.GetComputerId(); }
private void SUPERAbout_Load(object sender, EventArgs e) { lblProductID.Text = ComputerInfo.GetComputerId(); lblProductName.Text = "FireSide"; }
private void frmGenerate_Load(object sender, EventArgs e) { cboLicenseType.SelectedIndex = 0; txtProductID.Text = ComputerInfo.GetComputerId(); }
private void CodeRg_Load(object sender, EventArgs e) { tbProductID.Text = ComputerInfo.GetComputerId(); }
private void ActivatorCode_Load(object sender, EventArgs e) { ComboLicenceType.SelectedIndex = 0; tb_ProductID.Text = ComputerInfo.GetComputerId(); }
static void Main() { #if EASYTEST DevExpress.ExpressApp.Win.EasyTest.EasyTestRemotingRegistration.Register(); #endif Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); EditModelPermission.AlwaysGranted = System.Diagnostics.Debugger.IsAttached; VISA2014WindowsFormsApplication winApplication = new VISA2014WindowsFormsApplication(); winApplication.SetFormattingCulture("tk-TM"); #if EASYTEST if (ConfigurationManager.ConnectionStrings["EasyTestConnectionString"] != null) { winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["EasyTestConnectionString"].ConnectionString; } #endif //if (ConfigurationManager.ConnectionStrings["ConnectionString"] != null) //{ // winApplication.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; RegistryKey keyValues = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run\sqlConnection", true); // string keyName = @"Software\Microsoft\Windows\CurrentVersion\Run\sqlConnection"; if (keyValues != null && keyValues.ValueCount > 0) { try { string ip = keyValues.GetValue("ip").ToString(); //returns the text found in 'someValue' string userName = keyValues.GetValue("userName").ToString(); string password = keyValues.GetValue("password").ToString(); string databaseName = keyValues.GetValue("databaseName").ToString(); string connectionString = "Data Source=" + ip + ";Initial Catalog=" + databaseName + ";User ID=" + userName + ";Password="******"SQL error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { frmSQLConnection frmCon = new frmSQLConnection(); frmCon.ShowDialog(); } // } try { KeyManager km = new KeyManager(ComputerInfo.GetComputerId()); LicenseInfo lic = new LicenseInfo(); int value = km.LoadSuretyFile(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "Key.lic", ref lic); string productKey = lic.ProductKey; if (km.ValidKey(ref productKey)) { frmAbout fm = new frmAbout(); fm.ShowDialog(); winApplication.Setup(); winApplication.Start(); } else { Form1 frm = new Form1(); frm.ShowDialog(); } } catch (Exception e) { winApplication.HandleException(e); } }
private void Form1_Load(object sender, EventArgs e) { this.productID.Text = ComputerInfo.GetComputerId(); }
private void Regeistration_Load(object sender, EventArgs e) { txt_proudect.Text = ComputerInfo.GetComputerId(); }
private void RegistrationProduct_Loaded(object sender, RoutedEventArgs e) { textProductId.Text = ComputerInfo.GetComputerId(); }
private void SUPERGenerate_Load(object sender, EventArgs e) { txtProductID.Text = ComputerInfo.GetComputerId(); cmbTime.SelectedIndex = 0; }
private void RegisterSys_Load(object sender, EventArgs e) { txtProductID.Text = ComputerInfo.GetComputerId(); }