private void Form1DragDrop(object sender, DragEventArgs e) { var fileList = (string[])e.Data.GetData(DataFormats.FileDrop, false); foreach (var file in fileList) { string key; if (!CPUKeyCheck.GetCPUKeyFromFile(file, out key)) { continue; } keybox.Text = key; return; } }
private static void CheckFile(ref List <string> list, string src) { Program.SetStatus(string.Format("Checking {0}", src)); string key; if (!CPUKeyCheck.GetCPUKeyFromFile(src, out key)) { return; } Program.SetKey(key); if (CPUKeyCheck.VerifyKey(key)) { Verified.Add("Key: " + key + " File: " + src); return; } list.Add("Key: " + key + " File: " + src + " Fail reason: " + CPUKeyCheck.GetLastError()); }
private void CheckbtnClick(object sender, EventArgs e) { MessageBox.Show(CPUKeyCheck.VerifyKey(keybox.Text) ? "It's OK!" : string.Format("ERROR: {0}", CPUKeyCheck.GetLastError())); }