public static bool CheckSoftwareRegister() { Util.HOST_CODE = clsLxms.getCpu() + clsLxms.GetDiskVolumeSerialNumber(); Util.REGISTER_CODE = Util.Encrypt(Util.HOST_CODE, Util.PWD_MASK); Util.SOFT_REGISTER = false; RWReg reg = new RWReg("CURRENT_USER"); string regvalue = reg.GetRegValue(@"software\HBERP", Util.HOST_CODE, string.Empty); if (!string.IsNullOrEmpty(regvalue)) { if (Util.REGISTER_CODE.CompareTo(regvalue) == 0) { Util.SOFT_REGISTER = true; return(true); } else { return(false); } } else { return(false); } }
private void toolSaveAs_Click(object sender, EventArgs e) { try { this.Cursor = Cursors.WaitCursor; SaveFileDialog sfd = new SaveFileDialog(); RWReg reg = new RWReg("CURRENT_USER"); sfd.InitialDirectory = reg.GetRegValue(@"\software\microsoft\windows\currentversion\explorer\shell folders", "Desktop", string.Empty); sfd.FileName = this.ImageLocation.Substring(this.ImageLocation.LastIndexOf("\\") + 1); if (sfd.ShowDialog() == DialogResult.OK) { if (File.Exists(sfd.FileName)) { //if (MessageBox.Show(clsTranslate.TranslateString("This file is exist,do you want to override it?"), clsTranslate.TranslateString("Information"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return; File.Delete(sfd.FileName); } File.Copy(this.ImageLocation, sfd.FileName); MessageBox.Show(clsTranslate.TranslateString("File save success!"), clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } finally { this.Cursor = Cursors.Default; } }