Complete implementation of Asp.net program Registration

Source: Internet
Author: User
To effectively protect software, it is necessary to implement Asp.net Program . The idea of registering in this article is to obtain the ID number based on some machine codes on the server. The ID number is encrypted. Algorithm Encrypted to form a serial number. During registration, the user notifies the software equity Owner of the ID number, and the software equity Owner informs the user of the serial number. When a user registers based on the serial number, the serial number is saved in the database. Perform a registration check in the Asp.net program. Compare the serial number generated based on the machine code of the probe server with the serial number in the database. If the two are consistent, the registration program is used. Otherwise, the registration program is not used.
To achieve this function, this article provides a complete solution, which consists of the following files.
Reg_forcool.cs contains various functions that implement the registration function. It is used as an encapsulation reference and stored in the bin folder.
Reg. aspx and Reg. aspx. cs. The user requests a serial number from the software equity Owner for registration based on the ID number provided by the program.
Getsn. aspx and getsn. aspx. CS generate the serial number program and generate the serial number based on the user ID. This program is not provided to users and is saved by the software equity Owner.
Check_reg.aspx and check_reg.aspx.cs check whether the program is registered. This program can be transplanted to important pages that are required by other users.

// The following file: reg_forcool.csContains various functions that implement the registration function
// As an encapsulation reference and saved in the bin folder

Using system;
Using system. Data;
Using system. configuration;
Using system. collections;
Using system. Web;
Using system. Web. Security;
Using system. Collections. Generic;
Using system. text;
Using system. Management; // you need to add reference system. Management in Solution Explorer
Using system. Security; // you need to add reference system. Security in Solution Explorer
Using system. Security. cryptography;
Using system. IO;

Namespace reg_forcool_namespace
{
Public class reg_forcool_class
{

/// <Summary>
/// Obtain the MAC address of the NIC
/// </Summary>
/// <Returns> </returns>
Public String getnetcardmacaddress ()
{
Managementclass MC;
Managementobjectcollecti On MOC;
MC = new managementclass ("win32_networkadapter=at Ion ");
MoC = mc. getinstances ();
String STR = "";
Foreach (managementobject Mo in MoC)
{
If (bool) Mo ["ipenabled"] = true)
STR = Mo ["macaddress"]. tostring ();

           }
           STR = Str. Replace (":","");
           Return STR;
       }


//


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.