private void FormLoad(object sender, EventArgs e) { if (UnlockKey.IsRegistered()) { lblNote.Text = "This copy is registered."; } else { lblNote.Text = "This copy is not registered."; } }
private void btnRegister_Click(object sender, EventArgs e) { if (UnlockKey.Register(txtKey.Text)) { MessageBox.Show("Thank you for your registration.", ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information); Close(); } else { MessageBox.Show("Sorry, that's not the right key.\r\nMake sure you entered the value exactly as it\r\n" + "appears in your confirmation.\r\n\r\n", "Software Registration", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); lblNote.Text = "This copy is not registered."; UnlockKey.UnRegister(); } }