using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace HslCommunication.BasicFramework
{
///
/// 用来测试版软件授权的窗口
///
public partial class FormAuthorize : Form
{
///
/// 实例化授权注册窗口
///
///
/// 提示关于怎么获取注册码的信息
/// 加密的方法
public FormAuthorize(SoftAuthorize authorize,string aboutCode,Func encrypt)
{
InitializeComponent();
softAuthorize = authorize;
AboutCode = aboutCode;
Encrypt = encrypt;
}
private SoftAuthorize softAuthorize = null;
private void FormAuthorize_Load(object sender, EventArgs e)
{
textBox1.Text = softAuthorize.GetMachineCodeString();
}
private void userButton1_Click(object sender, EventArgs e)
{
if (softAuthorize.CheckAuthorize(textBox2.Text, Encrypt))
{
DialogResult = DialogResult.OK;
}
else
{
MessageBox.Show("注册码不正确");
}
}
Func Encrypt = null;
private string AboutCode { get; set; } = "";
private void linkLabel1_Click(object sender, EventArgs e)
{
MessageBox.Show(AboutCode);
}
}
}