Windows Forms: Generate Serial Key in C#
By FoxLearn 7/3/2017 8:54:44 PM 9K
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 create a Lucky Draw games in C#
- Windows Forms: Youtube Search with Paging in C#
- Windows Forms: Text to speech in C#
- Windows Forms: Print Picture Box in C#
- Windows Forms: Advanced Filter DataGridView in C#
- Windows Forms: Progress Bar in C#
- Windows Forms: How to Create a Random Password Generator in C#
- Windows Forms: Tag Control in C#
Categories
Popular Posts
Visual Studio: Auto increment version
04/01/2024
What is ARM architecture?
04/01/2024