[DllImport("WinlicenseSDK.dll", CallingConvention = CallingConvention.StdCall)]
public static extern bool WLRegNormalKeyCheck(string TextKey);
[DllImport("WinlicenseSDK.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
public static extern bool WLRegNormalKeyInstallToFileW(string TextKey);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
bool IsTextKeyCorrect = WLRegNormalKeyCheck(this.textBox1.Text.Trim());
if (!IsTextKeyCorrect)
{
MessageBox.Show("Key is INVALID", "Oceans 11");
}
else
{
WLRegNormalKeyInstallToFileW(this.textBox1.Text.Trim());
MessageBox.Show("Activation code is CORRECT. Product Registered\nApplication restarting to finish the registration", "Oceans 12");
Application.Restart();
}
}
Recommended Comments
There are no comments to display.