如何根据MAC地址生成许可证密钥? [英] how to generate the license key based on the MAC address?

查看:528
本文介绍了如何根据MAC地址生成许可证密钥?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



如何根据电脑的MAC地址生成许可证密钥。



i使用了以下代码:

hi to all,

how to generate the license key based on the MAC address of the Computer.

i have used the following code:

public string RandomString()
       {

           string input = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
           StringBuilder builder = new StringBuilder();
           char ch;
           for (int i = 0; i < 5; i++)
           {
               ch = input[rd.Next(0, input.Length)];
               builder.Append(ch);
           }
           return builder.ToString();

       }




private void btn_License_Click(object sender, EventArgs e)
        {

            string s1 = RandomString();
            string s2 = RandomString();
            string s3 = RandomString();
            string s4 = RandomString();
            string s5 = RandomString();
            textBox1.Text = s1 + " - " + s2 + " - " + s3 + " - " + s4 + " - " + s5;
}

推荐答案

这与MAC地址没有任何关系 - 你想要使用它们,你将首先拥有它们检索它。这将有所帮助:检索局域网的IP和MAC地址 [ ^ ] - 有一种方法可以检索当前的PC MAC地址。



但是 - 不要浪费太多时间:MAC地址可以欺骗,PC只有一个MAC地址,如果它有一个活动的网络连接器,大多数软件保护方法比合法用户更不方便海盗。您必须确定可能获得的盗版级别,通过保护软件和实施保护的时间成本,可以将多少盗版转换为销售。很多时候,这不值得努力......
That does nothing at all related to MAC addresses - it you want to use them, you will first have to retrieve it. This will help: Retrieving IP and MAC addresses for a LAN[^] - there is a method there to retrive the current PC MAC address.

But - don't waste too much time on this: MAC addresses can be spoofed, a PC will only have a MAC address if it has an active network connector, and most software protection methods annoy legitimate users more than they inconvenience pirates. You have to decide what level of piracy you are likely to get, how many of those can be converted into sales by protecting the software and the cost of the time to implement protection. Very often, it just isn't worth the effort...


这篇关于如何根据MAC地址生成许可证密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆