1

I am working on the Licence Key for activating Web application. Which could deployed on Physical server, virtual server, Shared hosting Server and (Azure cloud hosting) Native Cloud Server. This product is issue to one User at one Time.

I created the window Application Which tacking hardware Finger print current server and creating the licence key to the Web application. which store Hardware Finger print, Time period of Licence key issue. Which is fine in the Physical Server. it is Not Going to be Change.

This is The Code For Detecting the Hardware Print Link I am Detecting

  1. Manufacturer
  2. BiosId
  3. DiskId
  4. BaseId
  5. VideoId
  6. MacId

Now issue is that i can't use this Approach to the Virtual server and (Azure cloud hosting) Native Cloud Server.

Now I am trying to get

  1. Static Ip Address
  2. Domain Name
  3. GUID By System
  4. Location of File path (Where Application is install)

By using this four i am created the Product key. but still i don't know this for component is good to create unique Licence key.

Some Limitation i have found

  1. if (Azure cloud hosting) Cloud server IP Address is Changed. it not have static IP Address
  2. How i can deal with the Internal IP address and External IP address

just i need to know which component i can used to create the key. or what strategy i can used when hardware component is changing on Cloud and Virtual server.

mukesh UN singh
  • 232
  • 1
  • 14

1 Answers1

0

Each System have unique BIOS UUID. Which is unique in all the VM and System. this below method is how we can detect the System is running in virtual pc public static bool detectVPC() { using (var searcher = new System.Management.ManagementObjectSearcher("Select * from Win32_ComputerSystem")) { using (var items = searcher.Get()) { foreach (var item in items) { string manufacturer = item["Manufacturer"].ToString().ToLower(); if ((manufacturer == "microsoft corporation" && item["Model"].ToString().ToUpperInvariant().Contains("VIRTUAL")) || manufacturer.Contains("vmware") || item["Model"].ToString() == "VirtualBox") { return true; } } } } return false; }

Code for detecting the UUID:

public static string UUID
    {
        get
        {
            string uuid = string.Empty;

            ManagementClass mc = new ManagementClass("Win32_ComputerSystemProduct");
            ManagementObjectCollection moc = mc.GetInstances();

            foreach (ManagementObject mo in moc)
            {
                uuid = mo.Properties["UUID"].Value.ToString();
                break;
            }

            return uuid;
        }
    }

Which solve my issue. I tested this code by

  1. in Virual pc
  2. in Physical PC
  3. Copy the virtual hard disk
  4. created the clone of hard disk

i did test this code in the azure cloud and share hosting server

mukesh UN singh
  • 232
  • 1
  • 14