How to use Steinberg USB-elicenser in C# windows form application?

66 Views Asked by At

Please do not unovte or close this question. I am really helpless and have no idea what to do. I have created a simple C# winForm Applicaton. I made it run only when the particular serial key of a NOrmal USB is matched. Presently, I came to know about this USB e-licenser. I want to make my program run only when this device is installed. However, I do not have idea how to deal with this device. When I use eLicenser Control Center - License Management software,I can see the following:. The software also says that the serial number of this device is 1987756 - 54406E. Can anyone please help me how should I use the USB licenser in the follwing piece of C# code?

if (ValidHD()==true)
        {
            Application.Run(new Form1());
        }
        else
        {
            resultPOP = MessageBox.Show(messagePOP);
        }

 private static bool ValidHD()
    {
        int i = 0;
        bool retData = false;
        List<String> hdSNList = new List<string>();
        ManagementObjectSearcher moSearcher = new ManagementObjectSearcher("select * from Win32_DiskDrive");
        foreach (ManagementObject wmi_HDD in moSearcher.Get())
        {
            
            hdSNList.Add(wmi_HDD["SerialNumber"].ToString());
        }

        String[] hdSN = hdSNList.ToArray();

        while (hdSN.Length>i)
        {
            if (hdSN[i] == "1987756 - 54406E.")
            {
                retData = true;
            }
            i++;
        }
        if (retData)
        {
            return true;
        }
        else
        {
            return false;
        }
        
    }
0

There are 0 best solutions below