此为资源整理价格,不提供任何技术支持,不包安装。新手不要买!
源码仅供研究学习代码使用,严禁用于非法和商业用途!如需商业用途请去购买官方正版源码!
只适用于老手和技术大神!发货后谢绝退款行为!
【源码介绍】
可直接发邮箱给我,我发给你
免费
【源码截图】
【源码示例】
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;using My.License.Reg;namespace My.License.Demo{ public partial class Form1 : Form { public static int CheckRule = My.Framework.ConvertHelper.ToInt(My.Framework.Sys.SysConfig.GetAppSetting("CheckRule")); public Form1() { InitializeComponent(); } #region 授权处理 private bool isHasLicense = false;//是否已有许可证,默认为False #region 是否有权限码且正确 /// /// 是否有权限码且正确 /// /// public bool IsHasCode(ref string errorMsg) { string error = string.Empty; try { //2017-12-12 无软件系统及版本号授权 //isHasLicense = My.License.BizHelper.LicenseCheck.Instance.CheckLicense(ref errorMsg); //2017-12-12 无软件系统及版本号授权 //2017-12-12 有软件系统及版本号授权 isHasLicense = My.License.BizHelper.LicenseCheck.Instance.CheckLicense(ref errorMsg, new SoftInfo()); //2017-12-12 有软件系统及版本号授权 } catch (Exception ex) { error = ex.Message; isHasLicense = false; } return isHasLicense; } #endregion #region 获取相关License.xml文件 /// /// 是否有权限码且正确 /// /// public bool HasLicenseFile() { bool isHasLicenseXML = false; string error = string.Empty; try { string licenseXMLFilePath = My.Framework.FileHelper.GetApplicationPath() "\License.xml"; string[] tempArry = licenseXMLFilePath.Split('\');//MachineCode int fileNameLength = tempArry[tempArry.Length - 1].Length; string dir = licenseXMLFilePath.Substring(0, licenseXMLFilePath.Length - fileNameLength - 1); if (Directory.Exists(dir)) { if (File.Exists(licenseXMLFilePath)) { //string licenseCheckStr = MyLicense.Interface.ComputerInfoHelper.GetLicenseCheckStr(MyLicense.Interface.ComputerInfoHelper.GetCheckKey(), MachineCode, string.Empty); string licenseLscFilePath = My.Framework.FileHelper.GetApplicationPath() "\" MachineCode ".lsc"; isHasLicenseXML = (File.Exists(licenseLscFilePath)); } } } catch (Exception ex) { error = ex.Message; isHasLicenseXML = false; } return isHasLicenseXML; } #endregion #region 许可证已授权 /// /// 许可证已授权 /// public bool LicenseIsOK { get { return isHasLicense; } } #endregion #region 许可证已授权 /// /// 许可证已授权 /// public string MachineCode { get { return My.License.BizHelper.LicenseCheck.Instance.GetIMEI;//返回机器码串 } } #endregion private void Form1_Load(object sender, EventArgs e) { string errorMsg = string.Empty; if (IsHasCode(ref errorMsg) == false || HasLicenseFile() == false) { //this.Close(); //Application.Run(new LicenseImport()); this.Hide(); LicenseImport licenseFrm = new LicenseImport(); licenseFrm.Owner = this; licenseFrm.ShowDialog(); } else { string mgs = string.Empty; MessageBox.Show("OK"); } } #endregion }}