Windows Forms: Generate Serial Key in C#
By FoxLearn 7/3/2017 8:54:44 PM 9.08K
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 Use Form Load and Button click Event in C#
- How to use Advanced Filter DataGridView in C#
- How to use TagListControl in C#
- How to use Error Provider in C#
- How to Drag and Drop controls in C#
- How to Create a Random Password Generator in C#
- How to make an Application auto run on Windows startup in C#
- How to Create a Wait Form Dialog in C#
Categories
Popular Posts
C# Tutorial
07/20/2024
How to Download Microsoft SQL Server
06/22/2024
How to print a PDF file in C#
07/08/2024