private void CheckValidKeyOrNotInSoftware() { if (mKey.Length == 19) { if (!ActivationKey.IsValidLisenceKey(mKey)) { _IsSuccess = false; btnActivated.Enabled = false; btnActivated.Enabled = false; pbImgRightWrong.Image = global::DAPRO.Properties.Resources.Exit; return; } else { btnActivated.Enabled = true; _IsSuccess = true; pbImgRightWrong.Image = ((System.Drawing.Image)(resources.GetObject("pbImgRightWrong.Image"))); btnActivated.Enabled = true; } } else { pbImgRightWrong.Image = global::DAPRO.Properties.Resources.btnClearSelect; } }
private void SetRegistryKey() { string skey = mKey; if (mKey.Length == 19) { if (ActivationKey.SetRegistryKey(skey)) { _IsSuccess = true; pbImgRightWrong.Image = ((System.Drawing.Image)(resources.GetObject("pbImgRightWrong.Image"))); } else { _IsSuccess = false; pbImgRightWrong.Image = global::DAPRO.Properties.Resources.Exit; MessageBox.Show("Please enter a valid serial key.", "Invalid Key", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtKey1.Select(); } } else { _IsSuccess = false; pbImgRightWrong.Image = global::DAPRO.Properties.Resources.Exit; MessageBox.Show("Please enter a fourteen digit serial key.", "Invalid Key", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtKey1.Select(); } }
private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { if (txtKey1.Focused || txtKey2.Focused || txtKey3.Focused || txtKey4.Focused) { pbImgRightWrong.Image = ((System.Drawing.Image)(resources.GetObject("pbImgRightWrong.Image"))); _IsSuccess = true; txtKey1.Text = ""; txtKey2.Text = ""; txtKey3.Text = ""; txtKey4.Text = ""; string Copydate = Clipboard.GetText().Trim(); // Clipboard.Clear(); string[] key = Copydate.Split('-'); try { txtKey1.Text = key[0]; txtKey2.Text = key[1]; txtKey3.Text = key[2]; txtKey4.Text = key[3]; } catch (Exception) { _IsSuccess = false; pbImgRightWrong.Image = global::DAPRO.Properties.Resources.Exit; } } //***********Check valid or not************************** if (mKey.Length == 19) { if (!ActivationKey.SetRegistryKey(mKey)) { btnActivated.Enabled = false; btnActivated.Enabled = false; pbImgRightWrong.Image = global::DAPRO.Properties.Resources.Exit; return; } else { btnActivated.Enabled = true; _IsSuccess = true; pbImgRightWrong.Image = ((System.Drawing.Image)(resources.GetObject("pbImgRightWrong.Image"))); btnActivated.Enabled = true; } } }