Briefly. NET application Authorization actual steps

Source: Internet
Author: User

Read "read the following article" crack others application of the article feeling, brief. NET application authorization. ", the actual operation of their own to come to the experience. Here is the principle of the background AH What is not introduced, laugh at life has been written on his blog is quite clear, what does not understand the details can go to see the original. Recommend the first look at the original text, now look at my next steps, and then go back to study the details of the original. Because I write my own example is used in a company project, the source code is not convenient to put out, hehe.

First step: Generate a set of public and private keys, the public key for you to publish the program, the private key belongs to the registration code generation. View Plaincopy to Clipboardprint?

using (rsacryptoserviceprovider RSA = new RSACryptoServiceProvider ())
{
//Public key
String pubkey = RSA.  Toxmlstring (FALSE);
//private key
string prikey = RSA.  Toxmlstring (TRUE);
//If it is WebForm on Response.Write (PubKey + "<br/>" + Prikey); under
//If WinForm on MessageBox.Show ("Public key:" + PubKey + "RN private key:" + Prikey); Under
}
using (rsacryptoserviceprovider RSA = new RSACryptoServiceProvider ())
{
//public key
string PubKey = RSA. Toxmlstring (false);
Private key
String prikey = RSA. Toxmlstring (true);
If it is WebForm Response.Write (PubKey + "<br/>" + Prikey); Under
//If the WinForm is MessageBox.Show ("Public key:" + PubKey + "RN private key:" + Prikey); Next
}

Step two: Get the machine hardware code. I choose the number of the cup. View Plaincopy to Clipboardprint?

<summary>
///Get CPU number
///</summary>
///<returns></returns>
Public String Getcpuid ()
{
ManagementClass mc = new ManagementClass ("Win32_Processor");
Managementobjectcollection MOC = MC. GetInstances ();
String strcpuid = null;
foreach (ManagementObject mo in MoC)
{
strcpuid = mo. properties["Processorid"]. Value.tostring (); Break
;
return
strcpuid;
}
///<summary>
///get CPU number
///</summary>
///<returns></returns> Public
string Getcpuid ()
{
ManagementClass mc = new ManagementClass ("Win32_Processor");
Managementobjectcollection MOC = MC. GetInstances ();
String strcpuid = null;
foreach (ManagementObject mo in MoC)
{
strcpuid = mo. properties["Processorid"]. Value.tostring ();
break;
return strcpuid;
}

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.