Windows Forms: Generate Serial Key in C#
By FoxLearn 7/3/2017 8:54:44 PM 9.32K
Generate serial key & validate license key in C#
Step 1: Click New Project, then select Visual C# on the left, then Windows and then select Windows Forms Application. Name your project "SerialKeyDemo" and then click OK
Step 2: Right click on your project select Manage NuGet Packages -> Search SoftwareProtector -> Install
Software Protector is an open source 100% managed .NET licensing system based on SKGL Project. Generate keys for your software, and validate them using SKGL library in your own project.
Step 3: Design your form as below
Step 4: Add code to button click event handler as below
private void btnGenerate_Click(object sender, EventArgs e) { //Generate serial key SKGL.Generate generate = new SKGL.Generate(); generate.secretPhase = txtPassword.Text; txtSerial.Text = generate.doKey(Convert.ToInt32(txtDay.Text)); } private void btnValid_Click(object sender, EventArgs e) { //Check valid key SKGL.Validate validate = new SKGL.Validate(); validate.secretPhase = txtPassword.Text; validate.Key = txtSerial.Text; txtStatus.Text = "Creation date: " + validate.CreationDate + "\r\n" + "Expire date: " + validate.ExpireDate + "\r\n" + "Day left: " + validate.DaysLeft; }
VIDEO TUTORIALS
- How to make a Notepad in C#
- How to Receive SMS from WhatsApp in C#
- How to Add Combobox to DataGridView in C#
- How to Create Multiple pages on the Form using Panel control in C#
- How to insert Math Equation to RichTextBox in C#
- How to Send and Receive email in Microsoft Outlook using C#
- How to Print Windows Form in C#
- How to Use Form Load and Button click Event in C#
Categories
Popular Posts
How to download redis for Windows
10/29/2024