private void button3_Click(object sender, EventArgs e) { // 检测激活码是否正确,没有文件,或激活码错误都算作激活失败 if (!softAuthorize.IsAuthorizeSuccess(AuthorizeEncrypted)) { // 显示注册窗口 using (HslCommunication.BasicFramework.FormAuthorize form = new HslCommunication.BasicFramework.FormAuthorize( softAuthorize, "请联系XXX获取激活码", AuthorizeEncrypted)) { if (form.ShowDialog( ) != DialogResult.OK) { // 授权失败,退出 MessageBox.Show("授权失败!"); } else { MessageBox.Show("授权成功!"); } } } else { MessageBox.Show("授权成功!"); } }
private void button2_Click(object sender, EventArgs e) { // 检测激活码是否正确,没有文件,或激活码错误都算作激活失败 if (!softAuthorize.IsAuthorizeSuccess(AuthorizeEncrypted)) { // 显示注册窗口 using (HslCommunication.BasicFramework.FormAuthorize form = new HslCommunication.BasicFramework.FormAuthorize( softAuthorize, "请联系XXX获取激活码", AuthorizeEncrypted)) { if (form.ShowDialog( ) != DialogResult.OK) { // 授权失败,退出 Close( ); } else { // softAuthorize.SaveToFile( ); } } } else { MessageBox.Show("授权成功!"); } // 此处示例程序的机器码为:2E4C8EB0EBB8C4551C49AC277 // 直接进行判断,允不允许运行 // if (!softAuthorize.CheckAuthorize( "B384A9552ACFABF3CF839FB8A7CEAB123A264457BA0C176AE13F412CDD76C338", AuthorizeEncrypted )) // { // 检测授权失败 // Close( ); // } }