Windows Forms: Generate Serial Key in C#
By FoxLearn 7/3/2017 8:54:44 PM 9.37K
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 save files using SaveFileDialog in C#
- How to make an Alarm clock with sound in C#
- How to Display Images in DataGridView in C#
- How to Print DataGridView with Header & Footer with Landscape in C#
- How to Create a custom Progress Bar with Percentage in C#
- How to read an image file in C#
- How to use BackgroundWorker in C#
- How to protect .NET code from reverse engineering
Categories
Popular Posts
Flat Able Admin Dashboard Template
11/18/2024
Regal Admin Dashboard Template
11/18/2024
Plus Admin Dashboard Template
11/18/2024
Admin Tailwind CSS Admin Dashboard Template
11/18/2024