开发者

Get something unique about a computer in order to create a free trial

开发者 https://www.devze.com 2023-03-31 14:27 出处:网络
I know there are several ways of creating a free trials. My algorithm that I have thought is as follows:

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开发者_如何学Python 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.


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.


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;
}


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.


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.


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


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);

Get something unique about a computer in order to create a free trial

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

Get something unique about a computer in order to create a free trial

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:

Get something unique about a computer in order to create a free trial

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


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.


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); } }
            }
0

精彩评论

暂无评论...
验证码 换一张
取 消