static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var license = new TienX.License.LicenseManager(); string v_path = Directory.GetCurrentDirectory(); v_path = v_path + "\\iPostLicense.lic"; if (File.Exists(v_path)) { var v_lic = File.ReadAllText(v_path); var verify = license.verifyErrorCode(v_lic); if (verify == TienX.License.ErrorCode.Success) { Application.Run(new LoginFacebook()); } else if (verify == TienX.License.ErrorCode.Expired) { MessageBox.Show("Hết hạn dùng thử. Hãy nhập key mới để tiếp tục sử dụng"); Application.Run(new Login()); } else { // License may be modified or invalid license Application.Run(new Login()); } } else { Application.Run(new Login()); } }
private void m_cmd_reg_Click(object sender, EventArgs e) { try { var v_str_user_email = email.Text; var v_str_key = key.Text; var mn = new TienX.License.LicenseManager(); if (string.IsNullOrEmpty(v_str_key) || string.IsNullOrEmpty(v_str_user_email)) { MessageBox.Show("Bạn nhập key hoặc email nhé!"); return; } else { string v_past = Directory.GetCurrentDirectory(); v_past = v_past + "\\iPostLicense.lic"; var license = mn.requestLicenseAndSaveFile(v_str_key, v_str_user_email, v_past); if (mn.verifyLicense(license)) { MessageBox.Show("Bạn đã xác thực thành công. Kiếm tiền nào!"); this.Hide(); LoginFacebook v_f = new LoginFacebook(); v_f.ShowDialog(); this.Close(); } else { MessageBox.Show("Bạn điền giúp Email và key chuẩn nhé!"); } } //this.Hide(); //LoginFacebook v_f = new LoginFacebook(); //v_f.ShowDialog(); //this.Close(); } catch (Exception v_e) { MessageBox.Show("Có tý tẹo vấn đề. Bạn chụp ảnh và gửi để chúng tôi hỗ trợ nhé!" + v_e.ToString()); } }