Ejemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter   = "许可文件(*.lic)|*.lic";
            dlg.FileName = "MyLicense.lic";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                if (MyLicenseProvider.Validation(null, dlg.FileName))
                {
                    File.Copy(dlg.FileName, MyLicenseProvider.LicenseFullPath, true);
                    MessageBox.Show("License添加成功,请重新开启软件!");
                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                }
                else
                {
                    textBox1.Text = dlg.FileName;
                    MessageBox.Show("注册失败,请重新选择License!");
                }
            }
        }
Ejemplo n.º 2
0
 public LicenseManager()
 {
     InitializeComponent();
     this.txbCpuID.Text = MyLicenseProvider.GetCpuID();
 }