6

I know there are several ways of creating a free trials. My algorithm that I have thought is as follows:

  1. get something that identifies the computer where the application is installed. lets say I chose to get the windows product ID which may look something like: 00247-OEM-8992485-00078.

  2. then hash that string and say I end up with the string: ckeer34kijr9f09uswcojskdfjsdk

  3. then create a file with random letters and numbers something that looks like:

    ksfjksdfjs98w73899wf89u289uf9289frmu2f98um98ry723tyr98re812y89897982433mc98lpokojiaytfwhjdegwdehjhdjwhbdwhdiwhd78ey8378er83r78rhy378wrgt37678er827yhe8162e682eg8gt66gt.....etc

  4. then on the file that was random generated find the second number (in this case is 8) also find the last number (in this case it is 6) now multiply those numbers and you get 48: then that will be the position where I will start putting the hash string that I got which if you recall was: ckeer34kijr9f09uswcojskdfjsdk so the 48 character of the file happens to be a 'f' so replace that 'f' with the first character of the hash string which is c. so replace the f for c. then move two characters to the right to possition 50 and place the next hash string character etc...

  5. I could also encrypt the file and unencrypt it in order to be more secure.

  6. every time the user opens the program check that file and see if it follows the algorith. if it does not follow the algorithm then it means it is not a full version program.

so as you can see I just need to get something unique about the computer. I thought about getting the windows product key which that I think will be unique but I don't know how to get that. Another thing that I thought was getting the mac address. But I don't think that it is efficient because if the user changes it's nic card then the program will not work. Any information that is unique about the computer will help me a lot.

Tono Nam
  • 34,064
  • 78
  • 298
  • 470
  • 6
    There is nothing guaranteed to be unique about any computer. – John Saunders Aug 30 '11 at 13:54
  • what about the windows product id? several computers may have the same product id if purchased with the same licence? such as several computers in a school.... – Tono Nam Aug 30 '11 at 13:58
  • I don't know about product id, but unless Microsoft guarantees to you that it's unique, I wouldn't bet on uniqueness. – John Saunders Aug 30 '11 at 13:59
  • 1
    You could grab the CPU ID. They don't change often, and if someone swaps out their processors, they could call you to have you send a patch http://www.codeproject.com/KB/system/GetHardwareInformation.aspx –  Aug 30 '11 at 14:00
  • 2
    I have to say I HATE software that I have to go through an activation process to use. If I change my hardware out or install it on my second machine (I develop across 2 -3 machines) then I am out of luck and unless you have 24 hour support - I am stuck Friday night until Monday morning as that (by my luck) was when I had to use it and a change occurred. If you are using trial software - then I agree with the comment where you can encrypt a date and then just read that from the registry. That will deter most people. Hackers and Geeks however can use tools like Process Monitor and Reflector (or – tsells Aug 30 '11 at 15:56

8 Answers8

6

Everything just described is easily bypassed by someone willing to spend an hour working through it and writing a "hack".

Also, the Windows Product ID is not unique. Quite frankly, there is not a "unique id" for any computer. ( How to get ID of computer? )

I'd say, keep it simple. Just create a reg key with an encrypted date / time for expiration. Read the key on each program launch to determine when it should expire. Yes, this is just as easily hacked as before. However you won't spend a lot of time coming up with an uber complicated algorithm that is just as easy.

The point is, the Trial method is there to simply keep honest people honest. Those who are going to steal your application will do so regardless. So don't waste your time.

All of that said, I'd recommend that you don't even bother. Again, people who want to steal your app will. People who will pay for it will go ahead and pay. Instead of a time limited trial, change it to a feature limited app and give it away. If people want the additional features, they can pay for and download the unlocked version. At which point you give them some type of ID to put into the installer.

Community
  • 1
  • 1
NotMe
  • 87,343
  • 27
  • 171
  • 245
  • For the Registry entry, you could even give it some misleading name. If company name is *Bill's Software*, create and write to a key called *Font Repair* ...or whatever. –  Aug 30 '11 at 14:05
  • @jp2code Registry changes are easily tracked by anyone willing to do so. Lots of tools out there to monitor what an installer changes on your system. –  Aug 30 '11 at 14:41
  • 1
    @UrbanEsc: So are changes to the file system... I picked the registry simply because you aren't going to hide the fact that you are dropping a value on the machine in *any* location, so don't spend the resources trying to do so. Rather, just change your approach. – NotMe Aug 30 '11 at 14:50
  • @Chris, i was actually adressing jp2code there with the "hiding the value with misleading key" suggestion. If you are using the reg to do this you might as well use a name that has a meaning rather than trying to hide stuff someone will find anyway. I agree with you. –  Aug 30 '11 at 14:53
  • @UrbanEsc: Ahh... Got it. Ignore previous then. ;) – NotMe Aug 30 '11 at 14:55
  • @chris You say "Leave your door open. They who are honest will not enter. They who want to get in will enter in any case". However, leaving the door open is not a good way to protect home... – Jet Apr 19 '14 at 15:23
  • @Jet: I have a simple lock on the door to my house. Anyone walking up won't be able to turn the nob. However, if someone really wanted in then a hard kick will break the frame the door is attached to, or they could break a window. Point is: it is trivial to get into most houses on the planet. My answer can be summed up as: it doesn't matter if you use a really complicated mechanism or a simple one, they can all be bypassed. So, take a slightly different approach. – NotMe Apr 19 '14 at 22:07
5

I know a lot of companies use the MAC address for this. I'm not sure what pros and cons there are to this approach, but it's worth looking into.

I believe you can use a method like this to get the MAC address:

/// <summary>
/// returns the mac address of the first operation nic found.
/// </summary>
/// <returns></returns>
private string GetMacAddress()
{
    string macAddresses = "";

    foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces())
    {
        if (nic.OperationalStatus == OperationalStatus.Up)
        {
            macAddresses += nic.GetPhysicalAddress().ToString();
            break;
        }
    }
    return macAddresses;
}

This SO question discusses it in detail: Reliable method to get machine's MAC address in C#

EDIT

As others have pointed out, MAC address is not guaranteed to be unique. After doing a little more research, there are a couple of other options which might work better. The two that stuck out to me are:

  • Processor Serial Number
  • Hard Drive Volume Serial Number (VSN)

Get processor serial number:

using System.Management;

public string GetProcessorSerial()
{
    ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_BaseBoard");
    ManagementObjectCollection managementObjects = searcher.Get();

    foreach (ManagementObject obj in managementObjects)
    {
        if (obj["SerialNumber"] != null)
            return obj["SerialNumber"].Value.ToString();
    }

    return String.Empty;
}

Get HDD serial number:

using System.Management;

public string GetHDDSerial()
{
    ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia");    
    ManagementObjectCollection managementObjects = searcher.Get();

    foreach (ManagementObject obj in managementObjects)
    {
        if (obj["SerialNumber"] != null)
            return obj["SerialNumber"].ToString();
    }

    return string.Empty;
}
Community
  • 1
  • 1
James Johnson
  • 45,496
  • 8
  • 73
  • 110
  • MAC addresses come from the network card. A machine is not guaranteed to have just one. Sometimes they have zero and more often than not they have multiples. Further, it's pretty common to change out NIC's at which point the ID changes... I know I'm not "normal", but I've replaced 10 NICs in 5 computers over the past year. – NotMe Aug 30 '11 at 14:01
  • MAC address is not guaranteed globally unique, and a particular PC may not have one, or may have more than one, or the network card may be replaced, etc. – John Saunders Aug 30 '11 at 14:02
  • 1
    @John Saunders: I know it's not a perfect solution, but I also know that a lot of companies use it anyway. In your opinion, what is the best option for this? – James Johnson Aug 30 '11 at 14:11
  • 2
    IMHO the best option is to constantly improve your product and to sell support contracts only to paying customers. In other words, don't spend too much time trying to avoid thieves. – John Saunders Aug 30 '11 at 14:14
  • @John Saunders: Agreed. In the spirit of not spending too much time avoiding thieves, would a solution like this suffice in the majority of cases, as a quick check? – James Johnson Aug 30 '11 at 14:20
  • I wouldn't do this. It would lose the customers inconvenienced when they change a failing network card. – John Saunders Aug 30 '11 at 14:22
  • I agree with John and wouldn't do this at all. You're more likely to make paying customers mad than stop non-paying thieves. – NotMe Aug 30 '11 at 14:50
  • @Chris Lively: I posted two other options which are probably better than using the MAC address. Do you disagree with the other solutions as well? I agree that creating a GUID is the best option overall. – James Johnson Aug 30 '11 at 14:56
  • @James: Processor serial numbers haven't been implemented since the PII. Intel dropped it because of the public backlash. It's just an obsolete bit of garbage that's still hanging around and the number you get is not unique. Regarding Hard drives, what happens when the drive fails and they replace it and restore from backup? Drive failures are common enough that this would cause pain for customers that have paid for the software... ;) – NotMe Aug 30 '11 at 14:59
  • Chris Lively but if they replace the hard drive what are the odds that they replace the cpu, hard drive, nic card, windows serial key.... I will do like 5 of those and if all of them changes which it will be very wierd then they will still be able to use the software after authenticating with my server... and yeah they might be able to figure but I guess it will be a little harder... – Tono Nam Aug 30 '11 at 18:11
  • This doesn't work on .NET 2.0 (getting the CPU serial number)? :( – ashes999 Jun 04 '12 at 09:52
4

If you want something unique about a computer, then you need to put it there.

Create a GUID or other unique value, encrypt it, and store it on the computer and on your server.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
  • Could this also work with a Public Key in the Registry and a Private Key stored to an encrypted file in the Program's bin folder? –  Aug 30 '11 at 14:07
  • but if that file that I put there for some reason they find then they will be able to put that file on a different computer and be able to use it I believe... – Tono Nam Aug 30 '11 at 14:08
  • 2
    I didn't say this would solve all of your problems. It won't. The only solution for your problems is to get over the fact that dishonest people will steal your software. – John Saunders Aug 30 '11 at 14:10
  • yeah that is what I will do. I will put there several things in there such as the cpu id, motherboard id, mac address and a few more. I will encrypt all of them. if one of them match then the program will be unlocked. all of them they will have to authenticate with the server. and if there is the guy that want's to spend time trying to use my code then its ok. you are right people might still it. I will try my best to make it really complicated to still. – Tono Nam Aug 30 '11 at 14:41
  • @Tono Nam: So, you are going to require that people re-register or re-purchase your software in the event they swap out the processor, motherboard, network card or any of a number of other parts? This sounds like a support disaster. – NotMe Aug 30 '11 at 14:53
  • @Tono: I really wouldn't do that if I were you. Consider the cost of losing a customer vs. the cost of losing a copy of your software. – John Saunders Aug 30 '11 at 16:11
  • @Tono Nam: Late comment, after lunch: You could generate a different Public Key/Private Key pair during the Installation. The Private Key, since it is private, could be kept in Isolated Storage, based on Install Date, etc. Nothing is fool proof (just ask Microsoft about my pirated copy of Win7), but you can require someone to work for days before even getting close. –  Aug 30 '11 at 18:00
2

I used this code in my project. It reads the serial number of HDD:

using System.Management;
...
public string ReadHddSerial()
{
const string drive = "C";
ManagementObject disk = new ManagementObject("Win32_LogicalDisk.DeviceID=\"" + drive + ":\"");
 if (disk != null)
 {
     disk.Get();
     return disk["VolumeSerialNumber"].ToString();
 }
 return "other value (random ?)";
}

You can combine this method and reading MAC-addresses, for example.

somedev
  • 791
  • 11
  • 29
1

Try to combine multiple artifacts from a computer instead of just one.

Microsoft's Windows Product Activation uses multiple parmeters as described here:

http://www.aumha.org/win5/a/wpa.php

havardhu
  • 3,576
  • 2
  • 30
  • 42
  • *Some* forms of WPA use this. However, you have to reauthorize the machine when "enough" factors have changed. Never mind that it caused issues when companies cloned machines (standard practice) to quickly deploy new boxes.. It also requires a fair amount of back end support to enable customers to re-authorize their machine with a minimum of fuss... Which is time consuming to build and maintain. – NotMe Aug 30 '11 at 15:03
  • I agree, but he didn't ask how to manage free trials in the best way. He asked for something usable to uniquely identify a computer, and I said that one option is to combine multiple parameters to increase the chance of achieving that. So don't dismiss my answer just because you disagree with what he is trying to achieve. You already did that in your own answer. – havardhu Aug 30 '11 at 21:00
  • Just pointing out that the solution presented isn't as simple as picking a couple values off of the machine. One thing I always try to do is let an OP know the potential pitfalls that may exist which they may not even be aware of. – NotMe Aug 30 '11 at 21:11
1

There are so many things that may identify a computer. check this out!

using System;
using System.Linq;
using System.Management;

namespace MySystemInfo
{

        public abstract class Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } }

            protected static string GetWMI(Win32 win32)
            {

                string p = win32.GetType().GetProperty("property").GetValue(win32, null).ToString().Substring(1);
                ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM " + win32.Name);
                ManagementObjectCollection managementObjects = searcher.Get();
                try
                {
                    foreach (ManagementObject obj in managementObjects)
                    {
                        if (obj[p] != null)
                        {
                            var temp = obj[p];
                            return temp.ToString();
                        }
                    }
                }
                catch { }

                return String.Empty;
            }
        }

        public class Win32_BaseBoard : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Caption,
                _CreationClassName,
                _Depth,
                _Description,
                _Height,
                _HostingBoard,
                _HotSwappable,
                _InstallDate,
                _Manufacturer,
                _Model,
                _Name,
                _OtherIdentifyingInfo,
                _PartNumber,
                _PoweredOn,
                _Product,
                _Removable,
                _Replaceable,
                _RequirementsDescription,
                _RequiresDaughterBoard,
                _SerialNumber,
                _SKU,
                _SlotLayout,
                _SpecialRequirements,
                _Status,
                _Tag,
                _Version,
                _Weight,
                _Width
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_Battery : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Availability,
                _BatteryRechargeTime,
                _BatteryStatus,
                _Caption,
                _Chemistry,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _Description,
                _DesignCapacity,
                _DesignVoltage,
                _DeviceID,
                _ErrorCleared,
                _ErrorDescription,
                _EstimatedChargeRemaining,
                _EstimatedRunTime,
                _ExpectedBatteryLife,
                _ExpectedLife,
                _FullChargeCapacity,
                _InstallDate,
                _LastErrorCode,
                _MaxRechargeTime,
                _Name,
                _PNPDeviceID,
                _PowerManagementSupported,
                _SmartBatteryVersion,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName,
                _TimeOnBattery,
                _TimeToFullCharge
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_BIOS : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _BuildNumber,
                _Caption,
                _CodeSet,
                _CurrentLanguage,
                _Description,
                _IdentificationCode,
                _InstallableLanguages,
                _InstallDate,
                _LanguageEdition,
                _Manufacturer,
                _Name,
                _OtherTargetOS,
                _PrimaryBIOS,
                _ReleaseDate,
                _SerialNumber,
                _SMBIOSBIOSVersion,
                _SMBIOSMajorVersion,
                _SMBIOSMinorVersion,
                _SMBIOSPresent,
                _SoftwareElementID,
                _SoftwareElementState,
                _Status,
                _TargetOperatingSystem,
                _Version
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_Bus : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Availability,
                _BusNum,
                _BusType,
                _Caption,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _Description,
                _DeviceID,
                _ErrorCleared,
                _ErrorDescription,
                _InstallDate,
                _LastErrorCode,
                _Name,
                _PNPDeviceID,
                _PowerManagementSupported,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_CDROMDrive : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Availability,
                _Caption,
                _CompressionMethod,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _DefaultBlockSize,
                _Description,
                _DeviceID,
                _Drive,
                _DriveIntegrity,
                _ErrorCleared,
                _ErrorDescription,
                _ErrorMethodology,
                _FileSystemFlags,
                _FileSystemFlagsEx,
                _InstallDate,
                _LastErrorCode,
                _Manufacturer,
                _MaxBlockSize,
                _MaximumComponentLength,
                _MaxMediaSize,
                _MediaLoaded,
                _MediaType,
                _MfrAssignedRevisionLevel,
                _MinBlockSize,
                _Name,
                _NeedsCleaning,
                _NumberOfMediaSupported,
                _PNPDeviceID,
                _PowerManagementSupported,
                _RevisionLevel,
                _SCSIBus,
                _SCSILogicalUnit,
                _SCSIPort,
                _SCSITargetId,
                _SerialNumber,
                _Size,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName,
                _TransferRate,
                _VolumeName,
                _VolumeSerialNumber
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_DiskDrive : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Availability,
                _BytesPerSector,
                _Capabilities_,
                _CapabilityDescriptions_,
                _Caption,
                _CompressionMethod,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _DefaultBlockSize,
                _Description,
                _DeviceID,
                _ErrorCleared,
                _ErrorDescription,
                _ErrorMethodology,
                _FirmwareRevision,
                _Index,
                _InstallDate,
                _InterfaceType,
                _LastErrorCode,
                _Manufacturer,
                _MaxBlockSize,
                _MaxMediaSize,
                _MediaLoaded,
                _MediaType,
                _MinBlockSize,
                _Model,
                _Name,
                _NeedsCleaning,
                _NumberOfMediaSupported,
                _Partitions,
                _PNPDeviceID,
                _PowerManagementCapabilities_,
                _PowerManagementSupported,
                _SCSIBus,
                _SCSILogicalUnit,
                _SCSIPort,
                _SCSITargetId,
                _SectorsPerTrack,
                _SerialNumber,
                _Signature,
                _Size,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName,
                _TotalCylinders,
                _TotalHeads,
                _TotalSectors,
                _TotalTracks,
                _TracksPerCylinder
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_DMAChannel : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _16AddressSize,
                _16Availability,
                _BurstMode,
                _16ByteMode,
                _Caption,
                _16ChannelTiming,
                _CreationClassName,
                _CSCreationClassName,
                _CSName,
                _Description,
                _32DMAChannel,
                _InstallDate,
                _32MaxTransferSize,
                _Name,
                _32Port,
                _Status,
                _16TransferWidths_,
                _16TypeCTiming,
                _16WordMode
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_Fan : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _ActiveCooling,
                _Availability,
                _Caption,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _Description,
                _DesiredSpeed,
                _DeviceID,
                _ErrorCleared,
                _ErrorDescription,
                _InstallDate,
                _LastErrorCode,
                _Name,
                _PNPDeviceID,
                _PowerManagementCapabilities_,
                _PowerManagementSupported,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName,
                _VariableSpeed
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_FloppyController : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Availability,
                _Caption,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _Description,
                _DeviceID,
                _ErrorCleared,
                _ErrorDescription,
                _InstallDate,
                _LastErrorCode,
                _Manufacturer,
                _MaxNumberControlled,
                _Name,
                _PNPDeviceID,
                _PowerManagementSupported,
                _ProtocolSupported,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName,
                _TimeOfLastReset
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_FloppyDrive : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Availability,
                _Caption,
                _CompressionMethod,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _DefaultBlockSize,
                _Description,
                _DeviceID,
                _ErrorCleared,
                _ErrorDescription,
                _ErrorMethodology,
                _InstallDate,
                _LastErrorCode,
                _Manufacturer,
                _MaxBlockSize,
                _MaxMediaSize,
                _MinBlockSize,
                _Name,
                _NeedsCleaning,
                _NumberOfMediaSupported,
                _PNPDeviceID,
                _PowerManagementCapabilities_,
                _PowerManagementSupported,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_IDEController : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Availability,
                _Caption,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _Description,
                _DeviceID,
                _ErrorCleared,
                _ErrorDescription,
                _InstallDate,
                _LastErrorCode,
                _Manufacturer,
                _MaxNumberControlled,
                _Name,
                _PNPDeviceID,
                _PowerManagementCapabilities_,
                _PowerManagementSupported,
                _ProtocolSupported,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName,
                _TimeOfLastReset
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_IRQResource : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Availability,
                _Caption,
                _CreationClassName,
                _CSCreationClassName,
                _CSName,
                _Description,
                _Hardware,
                _InstallDate,
                _IRQNumber,
                _Name,
                _Shareable,
                _Status,
                _TriggerLevel,
                _TriggerType,
                _Vector
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_Keyboard : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Availability,
                _Caption,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _Description,
                _DeviceID,
                _ErrorCleared,
                _ErrorDescription,
                _InstallDate,
                _IsLocked,
                _LastErrorCode,
                _Layout,
                _Name,
                _NumberOfFunctionKeys,
                _Password,
                _PNPDeviceID,
                _PowerManagementSupported,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_MemoryDevice : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _Access,
                _AdditionalErrorData_,
                _Availability,
                _BlockSize,
                _Caption,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CorrectableError,
                _CreationClassName,
                _Description,
                _DeviceID,
                _EndingAddress,
                _ErrorAccess,
                _ErrorAddress,
                _ErrorCleared,
                _ErrorDataOrder,
                _ErrorDescription,
                _ErrorGranularity,
                _ErrorInfo,
                _ErrorMethodology,
                _ErrorResolution,
                _ErrorTime,
                _ErrorTransferSize,
                _InstallDate,
                _LastErrorCode,
                _Name,
                _NumberOfBlocks,
                _OtherErrorDescription,
                _PNPDeviceID,
                _PowerManagementCapabilities_,
                _PowerManagementSupported,
                _Purpose,
                _StartingAddress,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemLevelAddress,
                _SystemName
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_NetworkAdapter : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _AdapterType,
                _AdapterTypeID,
                _AutoSense,
                _Availability,
                _Caption,
                _ConfigManagerErrorCode,
                _ConfigManagerUserConfig,
                _CreationClassName,
                _Description,
                _DeviceID,
                _ErrorCleared,
                _ErrorDescription,
                _GUID,
                _Index,
                _InstallDate,
                _Installed,
                _InterfaceIndex,
                _LastErrorCode,
                _MACAddress,
                _Manufacturer,
                _MaxNumberControlled,
                _MaxSpeed,
                _Name,
                _NetConnectionID,
                _NetConnectionStatus,
                _NetEnabled,
                _NetworkAddresses_,
                _PermanentAddress,
                _PhysicalAdapter,
                _PNPDeviceID,
                _PowerManagementCapabilities_,
                _PowerManagementSupported,
                _ProductName,
                _ServiceName,
                _Speed,
                _Status,
                _StatusInfo,
                _SystemCreationClassName,
                _SystemName,
                _TimeOfLastReset
            }
            public string GetInfo { get { return GetWMI(this); } }
        }
        public class Win32_NetworkAdapterConfiguration : Win32
        {
            public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
            public enum Property
            {
                _ArpAlwaysSourceRoute,
                _ArpUseEtherSNAP,
                _Caption,
                _DatabasePath,
                _DeadGWDetectEnabled,
                _DefaultIPGateway_,
                _DefaultTOS,
                _DefaultTTL,
                _Description,
                _DHCPEnabled,
                _DHCPLeaseExpires,
                _DHCPLeaseObtained,
                _DHCPServer,
                _DNSDomain,
                _DNSDomainSuffixSearchOrder_,
                _DNSEnabledForWINSResolution,
                _DNSHostName,
                _DNSServerSearchOrder_,
                _DomainDNSRegistrationEnabled,
                _ForwardBufferMemory,
                _FullDNSRegistrationEnabled,
                _GatewayCostMetric_,
                _IGMPLevel,
                _Index,
                _InterfaceIndex,
                _IPAddress_,
                _IPConnectionMetric,
                _IPEnabled,
                _IPFilterSecurityEnabled,
                _IPPortSecurityEnabled,
                _IPSecPermitIPProtocols_,
                _IPSecPermitTCPPorts_,
                _IPSecPermitUDPPorts_,
                _IPSubnet_,
                _IPUseZeroBroadcast,
                _IPXAddress,
                _IPXEnabled,
                _IPXFrameType_,
                _IPXMediaType,
                _IPXNetworkNumber_,
                _IPXVirtualNetNumber,
                _KeepAliveInterval,
                _KeepAliveTime,
                _MACAddress,
                _MTU,
                _NumForwardPackets,
                _PMTUBHDetectEnabled,
                _PMTUDiscoveryEnabled,
                _ServiceName,
                _SettingID,
                _TcpipNetbiosOptions,
                _TcpMaxConnectRetransmissions,
                _TcpMaxDataRetransmissions,
                _TcpNumConnections,
                _TcpUseRFC1122UrgentPointer,
                _TcpWindowSize,
                _WINSEnableLMHostsLookup,
                _WINSHostLookupFile,
                _WINSPrimaryServer,
                _WINSScopeID,
                _WINSSecondaryServer
            }
            public string GetInfo { get { return GetWMI(this); } }
        }



}

now if lets say I want to get the serial number of the motherboard for example with intelesence I will do something like:

        var b = new MySystemInfo.Win32_BaseBoard();
        b.property = Win32_BaseBoard.Property._SerialNumber;
        MessageBox.Show("this computer BaseBoard serial number is: " + b.GetInfo);

enter image description here

also the nice part about this is the intelligence of visual studio:

enter image description here

on that picture I just showed you the availabel things that I could retrive about the Base Board but take a look at all the things that you may want to get:

enter image description here

Maybe you guys don't need this to create a free trial but it is a nice thing to have. hope you like it

Tono Nam
  • 34,064
  • 78
  • 298
  • 470
  • Several things here. First, not all motherboards have serial numbers on chip. Odd, I know, but true. Second, and this is much more important, different OS's (XP, Vista, 7) along with their service packs support and provide sometimes surprisingly different results to WMI queries. – NotMe Aug 30 '11 at 21:12
  • And, just so you know, I have an app deployed across 30,000+ machines whose sole purpose is to monitor for hardware and software changes and report back to a central server for a large entity. It was amazing the level of detail differences available just between SP1 and SP2 of Windows XP. Never mind differences caused by regular windows updates. Microsoft tends to quietly change WMI with their updates. – NotMe Aug 30 '11 at 21:15
  • Thats why I am saving a lot of data. If the motherboard does not work or it does not return a number then I will procede with the mac address and if that does not work then I will try to get the hard disk serial and keep going. If the user changes its hard drive then I will try to verify with the mac address etc... – Tono Nam Aug 30 '11 at 23:53
  • In other words two serials have to match out of the 10 things that I will try to retrive... – Tono Nam Aug 30 '11 at 23:55
0

thanks a lot for the help... So based on all your answers I thought about doing the following:

so it is true that there is not a specific part about a computer that identifies it. But it is true that some of the parts do not often change such as the mainboard infor, nic card, etc... so my new algorithm is as follows:

1) make the user have to create an account and save his email and password on my server.

2) get the users MainBoard info and create a file with the same algorithm that I previously showed.

3) get the users mac address if it has a nic card obviously and create another file with the same algorithm that I showed earlier.

3) get the users cpu ID and do the same thing.

4) maybe get yet another thing that at the moment is unique about that user maybe the hard disk serial something like that.

5) when the program lauches check to see if at least one of the files follow the algorithm. I mean what are the odds of someone changing its motherboard, nic card, cpu, etc... and if that does happen then require the user to go online in order to authenticate with the server. In other words the user may change it's nic card and the program will still launch because the file for the cpu serial still follows the algorithm.

Tono Nam
  • 34,064
  • 78
  • 298
  • 470
  • This is still easily hacked. When the program goes online to authenticate with the server, those packets can be captured, analyzed, and a response faked. Again, maybe an hours worth of work to deploy a hack. Which means, all you've done is increase the burden on paying clients (and yourself) while not preventing theft... – NotMe Aug 30 '11 at 15:05
  • Is cause I don't know that much about hacking @chris Lively. Moreover I just know the basics of encryption. so you are right if someone hacks my program then that's because he is not planing to pay anyway right... I will try to make my algorithm harder though. such as that the private key is a hash from the combination of two things of the computer plus other things... – Tono Nam Aug 30 '11 at 15:11
  • I don't think you're quite getting it. Any code you put on the clients machine can be traced to determine exactly how it determines it is okay to proceed. The hacker has two options. Option 1 is to simply bypass or remove that part of your code. This is the normal way. Option 2 is to redirect any communication between your app and a central server and inject anything they want. Point is, it doesn't matter what ID you give or use a hacker will get past it and *may* publish code for others to download to automate the hack. You can't win here, so package your product differently. – NotMe Aug 30 '11 at 15:16
  • Many customers will skip your product if you tie the trials to a specific machine. At the very least, you must make them aware that this is only for the trials, and that your real software isn't limited in that way. – John Saunders Aug 30 '11 at 16:12
  • Well you guys are right maybe I don't know that much about hacking and that's why I am thinking this way... – Tono Nam Aug 30 '11 at 18:17
0

I am not able to add so many characters on my previous questions. add this extra classes to the MySystemInfo namespace that I recently posted:

public class Win32_OnBoardDevice : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Caption,
                    _CreationClassName,
                    _Description,
                    _DeviceType,
                    _Enabled,
                    _HotSwappable,
                    _InstallDate,
                    _Manufacturer,
                    _Model,
                    _Name,
                    _OtherIdentifyingInfo,
                    _PartNumber,
                    _PoweredOn,
                    _Removable,
                    _Replaceable,
                    _SerialNumber,
                    _SKU,
                    _Status,
                    _Tag,
                    _Version
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_ParallelPort : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Availability,
                    _Capabilities_,
                    _CapabilityDescriptions_,
                    _Caption,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CreationClassName,
                    _Description,
                    _DeviceID,
                    _DMASupport,
                    _ErrorCleared,
                    _ErrorDescription,
                    _InstallDate,
                    _LastErrorCode,
                    _MaxNumberControlled,
                    _Name,
                    _OSAutoDiscovered,
                    _PNPDeviceID,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _ProtocolSupported,
                    _Status,
                    _StatusInfo,
                    _SystemCreationClassName,
                    _SystemName,
                    _TimeOfLastReset
                }
                public string GetInfo { get { return GetWMI(this); } }
            }

            public class Win32_PhysicalMedia : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Caption,
                    _Description,
                    _InstallDate,
                    _Name,
                    _Status,
                    _CreationClassName,
                    _Manufacturer,
                    _Model,
                    _SKU,
                    _SerialNumber,
                    _Tag,
                    _Version,
                    _PartNumber,
                    _OtherIdentifyingInfo,
                    _PoweredOn,
                    _Removable,
                    _Replaceable,
                    _HotSwappable,
                    _Capacity,
                    _MediaType,
                    _MediaDescription,
                    _WriteProtectOn,
                    _CleanerMedia
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_PhysicalMemory : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _BankLabel,
                    _Capacity,
                    _Caption,
                    _CreationClassName,
                    _DataWidth,
                    _Description,
                    _DeviceLocator,
                    _FormFactor,
                    _HotSwappable,
                    _InstallDate,
                    _InterleaveDataDepth,
                    _InterleavePosition,
                    _Manufacturer,
                    _MemoryType,
                    _Model,
                    _Name,
                    _OtherIdentifyingInfo,
                    _PartNumber,
                    _PositionInRow,
                    _PoweredOn,
                    _Removable,
                    _Replaceable,
                    _SerialNumber,
                    _SKU,
                    _Speed,
                    _Status,
                    _Tag,
                    _TotalWidth,
                    _TypeDetail,
                    _Version
                }
                public string GetInfo { get { return GetWMI(this); } }
            }

            public class Win32_PortResource : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Alias,
                    _Caption,
                    _CreationClassName,
                    _CSCreationClassName,
                    _CSName,
                    _Description,
                    _EndingAddress,
                    _InstallDate,
                    _Name,
                    _StartingAddress,
                    _Status
                }
                public string GetInfo { get { return GetWMI(this); } }
            }

            public class Win32_Processor : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _AddressWidth,
                    _Architecture,
                    _Availability,
                    _Caption,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CpuStatus,
                    _CreationClassName,
                    _CurrentClockSpeed,
                    _CurrentVoltage,
                    _DataWidth,
                    _Description,
                    _DeviceID,
                    _ErrorCleared,
                    _ErrorDescription,
                    _ExtClock,
                    _Family,
                    _InstallDate,
                    _L2CacheSize,
                    _L2CacheSpeed,
                    _L3CacheSize,
                    _L3CacheSpeed,
                    _LastErrorCode,
                    _Level,
                    _LoadPercentage,
                    _Manufacturer,
                    _MaxClockSpeed,
                    _Name,
                    _NumberOfCores,
                    _NumberOfLogicalProcessors,
                    _OtherFamilyDescription,
                    _PNPDeviceID,
                    _PowerManagementSupported,
                    _ProcessorId,
                    _ProcessorType,
                    _Revision,
                    _Role,
                    _SocketDesignation,
                    _Status,
                    _StatusInfo,
                    _Stepping,
                    _SystemCreationClassName,
                    _SystemName,
                    _UniqueId,
                    _UpgradeMethod,
                    _Version,
                    _VoltageCaps
                }
                public string GetInfo { get { return GetWMI(this); } }
            }

            public class Win32_SerialPort : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Availability,
                    _Binary,
                    _Capabilities_,
                    _CapabilityDescriptions_,
                    _Caption,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CreationClassName,
                    _Description,
                    _DeviceID,
                    _ErrorCleared,
                    _ErrorDescription,
                    _InstallDate,
                    _LastErrorCode,
                    _MaxBaudRate,
                    _MaximumInputBufferSize,
                    _MaximumOutputBufferSize,
                    _MaxNumberControlled,
                    _Name,
                    _OSAutoDiscovered,
                    _PNPDeviceID,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _ProtocolSupported,
                    _ProviderType,
                    _SettableBaudRate,
                    _SettableDataBits,
                    _SettableFlowControl,
                    _SettableParity,
                    _SettableParityCheck,
                    _SettableRLSD,
                    _SettableStopBits,
                    _Status,
                    _StatusInfo,
                    _Supports16BitMode,
                    _SupportsDTRDSR,
                    _SupportsElapsedTimeouts,
                    _SupportsIntTimeouts,
                    _SupportsParityCheck,
                    _SupportsRLSD,
                    _SupportsRTSCTS,
                    _SupportsSpecialCharacters,
                    _SupportsXOnXOff,
                    _SupportsXOnXOffSet,
                    _SystemCreationClassName,
                    _SystemName,
                    _TimeOfLastReset
                }
                public string GetInfo { get { return GetWMI(this); } }
            }

            public class Win32_SoundDevice : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Availability,
                    _Caption,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CreationClassName,
                    _Description,
                    _DeviceID,
                    _DMABufferSize,
                    _ErrorCleared,
                    _ErrorDescription,
                    _InstallDate,
                    _LastErrorCode,
                    _Manufacturer,
                    _MPU401Address,
                    _Name,
                    _PNPDeviceID,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _ProductName,
                    _Status,
                    _StatusInfo,
                    _SystemCreationClassName,
                    _SystemName
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_SystemEnclosure : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _AudibleAlarm,
                    _BreachDescription,
                    _CableManagementStrategy,
                    _Caption,
                    _ChassisTypes_,
                    _CreationClassName,
                    _CurrentRequiredOrProduced,
                    _Depth,
                    _Description,
                    _HeatGeneration,
                    _Height,
                    _HotSwappable,
                    _InstallDate,
                    _LockPresent,
                    _Manufacturer,
                    _Model,
                    _Name,
                    _NumberOfPowerCords,
                    _OtherIdentifyingInfo,
                    _PartNumber,
                    _PoweredOn,
                    _Removable,
                    _Replaceable,
                    _SecurityBreach,
                    _SecurityStatus,
                    _SerialNumber,
                    _ServiceDescriptions_,
                    _ServicePhilosophy_,
                    _SKU,
                    _SMBIOSAssetTag,
                    _Status,
                    _Tag,
                    _TypeDescriptions_,
                    _Version,
                    _VisibleAlarm,
                    _Weight,
                    _Width
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_TapeDrive : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Availability,
                    _Capabilities_,
                    _CapabilityDescriptions_,
                    _Caption,
                    _Compression,
                    _CompressionMethod,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CreationClassName,
                    _DefaultBlockSize,
                    _Description,
                    _DeviceID,
                    _ECC,
                    _EOTWarningZoneSize,
                    _ErrorCleared,
                    _ErrorDescription,
                    _ErrorMethodology,
                    _FeaturesHigh,
                    _FeaturesLow,
                    _Id,
                    _InstallDate,
                    _LastErrorCode,
                    _Manufacturer,
                    _MaxBlockSize,
                    _MaxMediaSize,
                    _MaxPartitionCount,
                    _MediaType,
                    _MinBlockSize,
                    _Name,
                    _NeedsCleaning,
                    _NumberOfMediaSupported,
                    _Padding,
                    _PNPDeviceID,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _ReportSetMarks,
                    _Status,
                    _StatusInfo,
                    _SystemCreationClassName,
                    _SystemName
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_TemperatureProbe : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Accuracy,
                    _Availability,
                    _Caption,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CreationClassName,
                    _CurrentReading,
                    _Description,
                    _DeviceID,
                    _ErrorCleared,
                    _ErrorDescription,
                    _InstallDate,
                    _IsLinear,
                    _LastErrorCode,
                    _LowerThresholdCritical,
                    _LowerThresholdFatal,
                    _LowerThresholdNonCritical,
                    _MaxReadable,
                    _MinReadable,
                    _Name,
                    _NominalReading,
                    _NormalMax,
                    _NormalMin,
                    _PNPDeviceID,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _Resolution,
                    _Status,
                    _StatusInfo,
                    _SystemCreationClassName,
                    _SystemName,
                    _Tolerance,
                    _UpperThresholdCritical,
                    _UpperThresholdFatal,
                    _UpperThresholdNonCritical
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_UninterruptiblePowerSupply : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _ActiveInputVoltage,
                    _Availability,
                    _BatteryInstalled,
                    _CanTurnOffRemotely,
                    _Caption,
                    _CommandFile,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CreationClassName,
                    _Description,
                    _DeviceID,
                    _ErrorCleared,
                    _ErrorDescription,
                    _EstimatedChargeRemaining,
                    _EstimatedRunTime,
                    _FirstMessageDelay,
                    _InstallDate,
                    _IsSwitchingSupply,
                    _LastErrorCode,
                    _LowBatterySignal,
                    _MessageInterval,
                    _Name,
                    _PNPDeviceID,
                    _PowerFailSignal,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _Range1InputFrequencyHigh,
                    _Range1InputFrequencyLow,
                    _Range1InputVoltageHigh,
                    _Range1InputVoltageLow,
                    _Range2InputFrequencyHigh,
                    _Range2InputFrequencyLow,
                    _Range2InputVoltageHigh,
                    _Range2InputVoltageLow,
                    _RemainingCapacityStatus,
                    _Status,
                    _StatusInfo,
                    _SystemCreationClassName,
                    _SystemName,
                    _TimeOnBackup,
                    _TotalOutputPower,
                    _TypeOfRangeSwitching,
                    _UPSPort
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_USBController : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Availability,
                    _Caption,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CreationClassName,
                    _Description,
                    _DeviceID,
                    _ErrorCleared,
                    _ErrorDescription,
                    _InstallDate,
                    _LastErrorCode,
                    _Manufacturer,
                    _MaxNumberControlled,
                    _Name,
                    _PNPDeviceID,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _ProtocolSupported,
                    _Status,
                    _StatusInfo,
                    _SystemCreationClassName,
                    _SystemName,
                    _TimeOfLastReset
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_USBHub : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Availability,
                    _Caption,
                    _ClassCode,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserCode,
                    _CreationClassName,
                    _CurrentAlternativeSettings,
                    _CurrentConfigValue,
                    _Description,
                    _DeviceID,
                    _ErrorCleared,
                    _ErrorDescription,
                    _GangSwitched,
                    _InstallDate,
                    _LastErrorCode,
                    _Name,
                    _NumberOfConfigs,
                    _NumberOfPorts,
                    _PNPDeviceID,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _ProtocolCode,
                    _Status,
                    _StatusInfo,
                    _SubclassCode,
                    _SystemCreationClassName,
                    _SystemName,
                    _USBVersion
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_VideoController : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _AcceleratorCapabilities_,
                    _AdapterCompatibility,
                    _AdapterDACType,
                    _AdapterRAM,
                    _Availability,
                    _CapabilityDescriptions_,
                    _Caption,
                    _ColorTableEntries,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CreationClassName,
                    _CurrentBitsPerPixel,
                    _CurrentHorizontalResolution,
                    _CurrentNumberOfColors,
                    _CurrentNumberOfColumns,
                    _CurrentNumberOfRows,
                    _CurrentRefreshRate,
                    _CurrentScanMode,
                    _CurrentVerticalResolution,
                    _Description,
                    _DeviceID,
                    _DeviceSpecificPens,
                    _DitherType,
                    _DriverDate,
                    _DriverVersion,
                    _ErrorCleared,
                    _ErrorDescription,
                    _ICMIntent,
                    _ICMMethod,
                    _InfFilename,
                    _InfSection,
                    _InstallDate,
                    _InstalledDisplayDrivers,
                    _LastErrorCode,
                    _MaxMemorySupported,
                    _MaxNumberControlled,
                    _MaxRefreshRate,
                    _MinRefreshRate,
                    _Monochrome,
                    _Name,
                    _NumberOfColorPlanes,
                    _NumberOfVideoPages,
                    _PNPDeviceID,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _ProtocolSupported,
                    _ReservedSystemPaletteEntries,
                    _SpecificationVersion,
                    _Status,
                    _StatusInfo,
                    _SystemCreationClassName,
                    _SystemName,
                    _SystemPaletteEntries,
                    _TimeOfLastReset,
                    _VideoArchitecture,
                    _VideoMemoryType,
                    _VideoMode,
                    _VideoModeDescription,
                    _VideoProcessor
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
            public class Win32_VoltageProbe : Win32
            {
                public string Name { get { return this.GetType().ToString().Split('+').Last().Split('.').Last(); } } public Property property { get; set; }
                public enum Property
                {
                    _Accuracy,
                    _Availability,
                    _Caption,
                    _ConfigManagerErrorCode,
                    _ConfigManagerUserConfig,
                    _CreationClassName,
                    _CurrentReading,
                    _Description,
                    _DeviceID,
                    _ErrorCleared,
                    _ErrorDescription,
                    _InstallDate,
                    _IsLinear,
                    _LastErrorCode,
                    _LowerThresholdCritical,
                    _LowerThresholdFatal,
                    _LowerThresholdNonCritical,
                    _MaxReadable,
                    _MinReadable,
                    _Name,
                    _NominalReading,
                    _NormalMax,
                    _NormalMin,
                    _PNPDeviceID,
                    _PowerManagementCapabilities_,
                    _PowerManagementSupported,
                    _Resolution,
                    _Status,
                    _StatusInfo,
                    _SystemCreationClassName,
                    _SystemName,
                    _Tolerance,
                    _UpperThresholdCritical,
                    _UpperThresholdFatal,
                    _UpperThresholdNonCritical
                }
                public string GetInfo { get { return GetWMI(this); } }
            }
Tono Nam
  • 34,064
  • 78
  • 298
  • 470