public void AddCurrent(OperatorModel operatorModel) { if (LoginProvider == "Cookie") { WebHelper.WriteCookie(LoginUserKey, DESEncrypt.Encrypt(operatorModel.ToJson()), 60); } else { WebHelper.WriteSession(LoginUserKey, DESEncrypt.Encrypt(operatorModel.ToJson())); } WebHelper.WriteCookie("nfine_mac", Md5.md5(Net.GetMacByNetworkInterface().ToJson(), 32)); WebHelper.WriteCookie("nfine_licence", LicenceHelper.GetLicence()); }
private void frmThietLapHeThong_KeyDown(object sender, KeyEventArgs e) { if (e.Control) { if (e.Control && e.Alt && e.Shift && e.KeyCode == Keys.P) { LicenceHelper myLicenceHelper = new LicenceHelper(); frmInputBox inputbox = new frmInputBox(); inputbox._nameForm = ""; inputbox._messageShow = "Key"; inputbox.set(); inputbox.ShowDialog(); string key = inputbox._result; string r = "2dab18f6aa55589be27a2fe657fac1b2"; if (myLicenceHelper.GetLicense(key, "doconvit") == r) { myLicenceHelper.GetLicense("doconvit"); MessageBox.Show("Kích hoạt bản quyền thành công"); } else { MessageBox.Show("Kích hoạt bản quyền thất bại"); } } if (e.Control && e.Shift && e.KeyCode == Keys.R) { frmInitDatabase myform = new frmInitDatabase(); myform._nameForm = "Tạo cơ sở dữ liệu mới"; myform._messageShow = "Nhập tên CSDL muốn khởi tạo: "; myform.set(); myform.ShowDialog(); string nameDatabase = myform._result; this.initDatabase(nameDatabase); } } if (e.KeyCode == Keys.Escape) { this.Close(); } }
static void Main() { bool success = false; try { string certification = LicenceHelper.ReadLicenceFile(); success = LicenceHelper.VerifyCertificate(certification); if (success) { run(); } } catch (Exception ex) { } if (!success) { MessageDialog dialog = new MessageDialog(); string code = LicenceHelper.GenerationCode(); dialog.ShowDialog("请申请注册文件([email protected])", code); } }