/// <summary> /// 检查注册码有效性 /// </summary> /// <param name="inputRegCode"></param> /// <returns></returns> public static bool CheckRegCode(string inputRegCode = "") { bool result = false; string regCode = ""; if (string.IsNullOrEmpty(inputRegCode)) { //读取配置文件注册码 XmlDocument doc = new XmlDocument(); string configFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Config.xml"); doc.Load(configFilePath); XmlNodeList nodes = doc.SelectNodes("/Config/RegCode/value"); if (nodes.Count > 0) { regCode = nodes[0].InnerText; } } else { regCode = inputRegCode; } byte[] bytes = Encoding.Default.GetBytes(GetSerial.getMNum() + "sinldo.com"); string realRegCode = Convert.ToBase64String(bytes); if (realRegCode == regCode) { result = true; } return(result); }
private void btnSetWordPath_Click(object sender, EventArgs e) { string num = GetSerial.getMNum(); FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.Description = "请设置文件夹生成路径"; if (dialog.ShowDialog() == DialogResult.OK) { string foldPath = dialog.SelectedPath; txtWorkPath.Text = foldPath; } }