private void btnGenerator_Click(object sender, EventArgs e) { try { AuthLicenseObject license = new AuthLicenseObject(); license.AppName = this.cbAppName.Text.Trim(); license.Company = this.txtCompany.Text.Trim(); license.MachineCode = this.txtMAC.Text.Trim(); license.TerminalNum = Convert.ToInt32(this.txtTerminalNum.Text.Trim()); license.UserNum = Convert.ToInt32(this.txtUserNum.Text.Trim()); AuthLicenseHelper.CreateLicenseFile(license); MessageBox.Show("授权成功!授权文件已经产生在C盘目录下"); } catch (Exception ex) { MessageBox.Show("授权失败!" + ex.ToString()); } }
private void btnGenerator_Click(object sender, EventArgs e) { try { AuthLicenseObject license = new AuthLicenseObject(); license.AppName = this.cbAppName.Text.Trim(); license.Company = this.txtCompany.Text.Trim(); license.MachineCode = this.txtMAC.Text.Trim(); license.TerminalNum = Convert.ToInt32(this.txtTerminalNum.Text.Trim()); license.UserNum = Convert.ToInt32(this.txtUserNum.Text.Trim()); AuthLicenseHelper.CreateLicenseFile(license); MessageBox.Show("授权成功!授权文件已经产生在C盘目录下"); } catch (Exception ex) { MessageBox.Show("授权失败!"+ex.ToString()); } }
private void cbAppName_SelectedIndexChanged(object sender, EventArgs e) { AuthLicenseObject license = FT.AuthLicense.AuthLicenseHelper.GetLicense(this.cbAppName.Text.Trim()); if (license != null) { this.txtCompany.Text = license.Company; this.txtMAC.Text = license.MachineCode; this.txtRightCode.Text = license.RightCode; this.txtTerminalNum.Text = license.TerminalNum.ToString(); this.txtUserNum.Text = license.UserNum.ToString(); } else { this.txtCompany.Text = "未找到授权文件!"; this.txtMAC.Text = string.Empty; this.txtTerminalNum.Text = string.Empty; this.txtRightCode.Text = string.Empty; this.txtUserNum.Text = string.Empty; } }