Kommunikation über SerialPort (COM)

Weiterführende Infos zum Thema Serial Port: Hanselman und MSDN

using System.IO.Ports;

public class CRS232
{
    private SerialPort _sp = new SerialPort();

    public CRS232(string sPortName, bool bRTSEnable, int iBaudRate, int iDataBits, int iReadTimeOut, int iWriteTimeOut, StopBits eStopBits, Parity eParity, Handshake eHandShake, Encoding eEncoding)
  {
        _sp.PortName = sPortName;
        _sp.RtsEnable = bRTSEnable;
        _sp.BaudRate = iBaudRate;
        _sp.DataBits = iDataBits;
        _sp.ReadTimeout = iReadTimeOut;
        _sp.WriteTimeout = iWriteTimeOut;
        // StopBits.None;
        // StopBits.One;
        // StopBits.OnePointFive;
        // StopBits.Two;
        _sp.StopBits = eStopBits;
        // Parity.Even;
        // Parity.Odd;
        // Parity.None;
        // Parity.Space;
        // Parity.Mark;
        _sp.Parity = eParity;
        // Handshake.XOnXOff;
        // Handshake.None;
        _sp.Handshake = eHandShake;
        _sp.Encoding = eEncoding;
  }

    public string[] GetPorts()
    {
        return SerialPort.GetPortNames();
    }

    public bool Open()
    {
        bool bRetVal = false;

        try
        {
            if (!_sp.IsOpen)
            {
                _sp.Open();
            }
            bRetVal = true;
        }
        catch (Exception)
        {
        }

        return bRetVal;
    }

    public bool Close()
    {
        bool bRetVal = false;

        try
        {
            if (!_sp.IsOpen)
            {
                _sp.Close();
            }
            bRetVal = true;
        }
        catch (Exception)
        {
        }

        return bRetVal;
    }

    public string ReadLine()
    {
        string sRetVal = string.Empty;

        try
        {
            if (_sp.IsOpen)
            {
                sRetVal = _sp.ReadLine();
            }
        }
        catch (Exception)
        {
        }

        return sRetVal;
    }

    public bool WriteLine(string sText)
    {
        bool bRetVal = false;

        try
        {
            if (_sp.IsOpen)
            {
                _sp.WriteLine(sText);
            }
        }
        catch (Exception)
        {
        }

        return bRetVal;
    }
}

Windows-Anwendung ohne Fenster starten

// Programm.cs
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using SimulationSystem.Forms;

namespace MyNameSpace
{
    static class Program
    {
        /// <summary>
        /// Der Haupteinstiegspunkt für die Anwendung.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // in der Run-Methode kein Hauptformular angeben
            Application.Run();
        }
    }
}

[C#] Eingebettete Resourcen aus Resources.resx auslesen

  • Resourcendatei muss im Projektbaum unter Projektname->Properties->Resources.resx vorhanden sein
  • auf Resources.resx Doppelklicken (öffnen) und oben Resource hinzufügen->Vorhandene Datei hinzufügen … wählen
  • Datei auswählen (bmp, ico, txt, wav …) und hinzufügen, die Resource wird nun ohne Dateinamenerweiterung im Designer hinterlegt
  • Zugriff auf die hinterlegte Resourcen Properties.Resources:
    using System.Drawing;
    using System.Resources;
    using System.Reflection;
    
    class CMyClass
    {
        // Button, der ein Bildchen aus der Resource verwenden soll
        private Button _btnTest = new Button();
        // Imagelist, die Images beinhaltet
        private ImageList _ilImages = new ImageList();
    
        public CMyClass()
        {
            // Bitmap anhand seines Resourcen-Namens holen
            Bitmap bmpTest = Properties.Resources.BmpTest;
    
            // Imagelist vorbereiten
            _ilImages.ColorDepth = ColorDepth.Depth32Bit;
            _ilImages.ImageSize = new Size(16, 16);
            _ilImages.TransparentColor = Color.Black; // transparente Farbe festlegen
    
            // Bild hinzufügen
            _ilImages.Images.Add(bmpTest);
    
            // Bild für Button festlegen
            _btnStartStop.ImageList = _ilImages;
            // Index des Bitmaps in der Imagelist
            _btnTest.ImageIndex = 0;
        }
    }
    
  • Zugriff auf die hinterlegte Resourcen über ResourceManager:
    using System.Drawing;
    using System.Resources;
    using System.Reflection;
    
    class CMyClass
    {
        // Button, der ein Bildchen aus der Resource verwenden soll
        private Button _btnTest = new Button();
        // Imagelist, die Images beinhaltet
        private ImageList _ilImages = new ImageList();
    
        public CMyClass()
        {
            // Bilder aus lokalen Resources.resx holen
            // wobei "Standardnamespace" meist der Projektname ist
            ResourceManager rm = new ResourceManager("Standardnamespace.Properties.Resources", Assembly.GetExecutingAssembly());
    
            // Bitmap anhand seines Namens (ohne Dateinamenerweiterung!) aus der Resource holen
            Bitmap bmpTest = rm.GetObject("BmpTest") as Bitmap;
    
            // Imagelist vorbereiten
            _ilImages.ColorDepth = ColorDepth.Depth32Bit;
            _ilImages.ImageSize = new Size(16, 16);
            _ilImages.TransparentColor = Color.Black; // transparente Farbe festlegen
    
            // Bild hinzufügen
            _ilImages.Images.Add(bmpTest);
    
            // Bild für Button festlegen
            _btnStartStop.ImageList = _ilImages;
            // Index des Bitmaps in der Imagelist
            _btnTest.ImageIndex = 0;
        }
    }
    

HIWORD und LOWORD eines uint in short wandeln

uint uiCoordinates = 786456;

// unsigned int (4 Bytes) in byte-Array zerlegen
byte[] byaInt = BitConverter.GetBytes(uiCoordinates);

// obere 2 Bytes (HIWORD) auslesen: x = 24
short _iX = BitConverter.ToInt16(byaInt, 0);
// untere 2 Bytes (LOWORD) auslesen: y = 12
short _iY = BitConverter.ToInt16(byaInt, 2);

Bitmaske Byte

  • Klasse zum Erzeugen einer Bitmaske aus einem Byte und umgekehrt
static void Main(string[] args)
{
    BitMaskFromByte bm = new BitMaskFromByte();

    ushort[] b = { 1, 1, 1, 1, 0, 1, 1, 0 }; // 111 dezimal

    bm.Mask = b;

    Console.WriteLine("{0}: {1}", bm.ByteData.ToString(), bm.ToString());

    Console.ReadLine();
}
  • Code
public class BitMaskFromByte
{
    private byte _byData = 0;
    ushort[] _usMask = { 0, 0, 0, 0, 0, 0, 0, 0};

    public BitMaskFromByte()
    {
    }

    // Property für Byte I/O
    public byte ByteData
    {
        get
        {
            return _byData;
        }

        set
        {
            _byData = value;

            for (int i = 0; i < _usMask.Length; i++)
            {
                _usMask[i] = BitIsSet(i);
            }
        }
    }

    // Property für Bitmaske
    public ushort[] Mask
    {
        get
        {
            return _usMask;
        }

        set
        {
            _usMask = value;

            // Hilfsvariable, da mit ushort und byte keine Rechenop. möglich sind
            uint _uiData = 0;

            for (int i = 0; i < _usMask.Length; i++)
            {
                if (_usMask[i] == 1)
                {
                    _uiData = _uiData + (uint)Math.Pow(2.0, i);
                }
            }

            // niederwertigstes Byte (0) von uint zurückgeben
            _byData = BitConverter.GetBytes(_uiData)[0];
        }
    }

    // Hilfsfunktion
    public ushort BitIsSet(int iIndex)
    {
        ushort usRetVal = 0;

        // 2^0=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16, 2^5=32, 2^6=64, 2^7=128
        byte[] byMask = { 1, 2, 4, 8, 16, 32, 64, 128 };

        if ((_byData & byMask[iIndex]) == byMask[iIndex])
        {
            usRetVal = 1;
        }

        return usRetVal;
    }

    // überschriebene Funktion für die formatierte Ausgabe der Bitmaske
    public override string ToString()
    {
        string sRetVal = "";

        for (int i = 0; i < _usMask.Length; i++)
        {
            sRetVal = sRetVal + _usMask[i].ToString();
        }

        return sRetVal;
    }
}

Unsicheren Code (Pointer) verwenden

  • Um unsichern Code (mit Pointern) compilieren zu können muss folgende Einstellung vorgenommen werden: Projekt->Eigenschaften->Erstellen->Unsicheren Code zulassen
  • unsicheren Code (unsafe) innerhalb einer Methode deklarieren
static void Main(string[] args)
{
    unsafe
    {
        int iValue = 10;
        int* piValue = null;

        piValue = &iValue;

        Console.WriteLine("{0}", *piValue);
    }
}
  • ganze Methode als unsafe deklarieren
unsafe static void Main(string[] args)
{
    int iValue = 10;
    int* piValue = null;

    piValue = &iValue;

    Console.WriteLine("{0}", *piValue);
}

System- und Hardwareinformationen über WMI abfragen

Windows Management Instrumentation (WMI)

  • CPU Infos auslesen
// Projekt->Verweise->Verweis hinzufügen->.NET->System.Management
using System.Management;

ManagementObjectSearcher mosObj = new ManagementObjectSearcher("select * from Win32_Processor");

foreach (ManagementObject moWMIInst in mosObj.Get())
{
    // als erstes die Anzahl der CPU-Kerne auslesen
    int iCountCores;

    // Property "NumberOfCores" direkt ansprechen
    if (int.TryParse(moWMIInst["NumberOfCores"].ToString(), out iCountCores))
    {
        Console.WriteLine(iCountCores.ToString());
    }

    // abschließend nochmal alle verfügbaren Properties von "Win32_Processor" auflisten
    foreach (PropertyData pdObj in moWMIInst.Properties)
    {
        Console.WriteLine("{0}: {1}", pdObj.Name, (pdObj.Value != null) ? pdObj.Value.ToString() : "n/a");
    }
}
  • alle aktuell laufende Services listen
// Projekt->Verweise->Verweis hinzufügen->.NET->System.Management
using System.Management;

ManagementObjectSearcher mosObj = new ManagementObjectSearcher("SELECT * FROM Win32_Service WHERE Started = TRUE");

foreach (ManagementObject moService in mosObj.Get())
{
    Console.WriteLine("Service: " + moService["Name"].ToString());
    Console.WriteLine(moService["Caption"].ToString());
    Console.WriteLine(moService.Path.RelativePath.ToString());
}
  • Windows Variablen abfragen
// Projekt->Verweise->Verweis hinzufügen->.NET->System.Management
using System.Management;

ManagementObjectSearcher mosObj = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem");

foreach(ManagementObject moWin in mosObj.Get()) 
{
    Console.WriteLine("Name : " + moWin["Name"].ToString());
    Console.WriteLine("Version : " + moWin["Version"].ToString());
    Console.WriteLine("Manufacturer : " + moWin["Manufacturer"].ToString());
    Console.WriteLine("Computer Name : " + moWin["Csname"].ToString());
    Console.WriteLine("Windows Directory : " + moWin["WindowsDirectory"].ToString());
}
  • Netzwerkkarten auslesen
// Projekt->Verweise->Verweis hinzufügen->.NET->System.Management
using System.Management;

ManagementObjectSearcher query = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = TRUE");

foreach (ManagementObject moNetAdapter in query.Get())
{
    string[] sIP = (string[])moNetAdapter["IPAddress"];
    string[] sSubNet = (string[])moNetAdapter["IPSubnet"];
    string[] sGate = (string[])moNetAdapter["DefaultIPGateway"];

    Console.WriteLine(moNetAdapter["Description"].ToString());
    Console.WriteLine("MAC: " + moNetAdapter["MACAddress"].ToString());

    if (sIP != null)
    {
        foreach (string sIPAdr in sIP)
        {
            Console.WriteLine("IP: " + sIPAdr);
        }
    }

    if (sSubNet != null)
    {
        foreach (string sSubNetMask in sSubNet)
        {
            Console.WriteLine("Subnetzmaske: " + sSubNetMask);
        }
    }

    if (sGate != null)
    {
        foreach (string sDefGate in sGate)
        {
            Console.WriteLine("Gateway: " + sDefGate);
        }
    }
}
  • BIOS Informationen auslesen
// Projekt->Verweise->Verweis hinzufügen->.NET->System.Management
using System.Management;

ManagementObjectSearcher mosBIOS = new ManagementObjectSearcher("SELECT * FROM Win32_BIOS");

foreach (ManagementObject moObj in mosBIOS.Get())
{
    foreach (PropertyData pdObj in moObj.Properties)
    {
        string sValue = "";

        if (pdObj.Value != null)
        {
            // da die Properties von verschiedenen Typen sein können
            // müssen die Werte entsprechend typabhängig gewandelt werden
            switch (pdObj.Value.GetType().ToString())
            {
                case "System.String[]" :
                    string[] sEl = (string[])pdObj.Value;
                    foreach (string sE in sEl)

                    {
                        sValue += sE + " ";
                    }
                    break;

                case "System.UInt16[]":
                    System.UInt16[] uiEl = (System.UInt16[])pdObj.Value;
                    foreach (System.UInt16 uiE in uiEl)
                    {
                        sValue += uiE.ToString() + " ";
                    }
                    break;

                default:
                    sValue = pdObj.Value.ToString();
                    break;
            }
        }

        Console.WriteLine(pdObj.Name + ": " + sValue);
    }
}
  • vollständige Liste der Key-Strings
Win32_1394Controller
Win32_1394ControllerDevice
Win32_Account
Win32_AccountSID
Win32_ACE
Win32_ActionCheck
Win32_AllocatedResource
Win32_ApplicationCommandLine
Win32_ApplicationService
Win32_AssociatedBattery
Win32_AssociatedProcessorMemory
Win32_BaseBoard
Win32_BaseService
Win32_Battery
Win32_Binary
Win32_BindImageAction
Win32_BIOS
Win32_BootConfiguration
Win32_Bus
Win32_CacheMemory
Win32_CDROMDrive
Win32_CheckCheck
Win32_CIMLogicalDeviceCIMDataFile
Win32_ClassicCOMApplicationClasses
Win32_ClassicCOMClass
Win32_ClassicCOMClassSetting
Win32_ClassicCOMClassSettings
Win32_ClassInfoAction
Win32_ClientApplicationSetting
Win32_CodecFile
Win32_COMApplication
Win32_COMApplicationClasses
Win32_COMApplicationSettings
Win32_COMClass
Win32_ComClassAutoEmulator
Win32_ComClassEmulator
Win32_CommandLineAccess
Win32_ComponentCategory
Win32_ComputerSystem
Win32_ComputerSystemProcessor
Win32_ComputerSystemProduct
Win32_COMSetting
Win32_Condition
Win32_CreateFolderAction
Win32_CurrentProbe
Win32_DCOMApplication
Win32_DCOMApplicationAccessAllowedSetting
Win32_DCOMApplicationLaunchAllowedSetting
Win32_DCOMApplicationSetting
Win32_DependentService
Win32_Desktop
Win32_DesktopMonitor
Win32_DeviceBus
Win32_DeviceMemoryAddress
Win32_DeviceSettings
Win32_Directory
Win32_DirectorySpecification
Win32_DiskDrive
Win32_DiskDriveToDiskPartition
Win32_DiskPartition
Win32_DisplayConfiguration
Win32_DisplayControllerConfiguration
Win32_DMAChannel
Win32_DriverVXD
Win32_DuplicateFileAction
Win32_Environment
Win32_EnvironmentSpecification
Win32_ExtensionInfoAction
Win32_Fan
Win32_FileSpecification
Win32_FloppyController
Win32_FloppyDrive
Win32_FontInfoAction
Win32_Group
Win32_GroupUser
Win32_HeatPipe
Win32_IDEController
Win32_IDEControllerDevice
Win32_ImplementedCategory
Win32_InfraredDevice
Win32_IniFileSpecification
Win32_InstalledSoftwareElement
Win32_IRQResource
Win32_Keyboard
Win32_LaunchCondition
Win32_LoadOrderGroup
Win32_LoadOrderGroupServiceDependencies
Win32_LoadOrderGroupServiceMembers
Win32_LogicalDisk
Win32_LogicalDiskRootDirectory
Win32_LogicalDiskToPartition
Win32_LogicalFileAccess
Win32_LogicalFileAuditing
Win32_LogicalFileGroup
Win32_LogicalFileOwner
Win32_LogicalFileSecuritySetting
Win32_LogicalMemoryConfiguration
Win32_LogicalProgramGroup
Win32_LogicalProgramGroupDirectory
Win32_LogicalProgramGroupItem
Win32_LogicalProgramGroupItemDataFile
Win32_LogicalShareAccess
Win32_LogicalShareAuditing
Win32_LogicalShareSecuritySetting
Win32_ManagedSystemElementResource
Win32_MemoryArray
Win32_MemoryArrayLocation
Win32_MemoryDevice
Win32_MemoryDeviceArray
Win32_MemoryDeviceLocation
Win32_MethodParameterClass
Win32_MIMEInfoAction
Win32_MotherboardDevice
Win32_MoveFileAction
Win32_MSIResource
Win32_NetworkAdapter
Win32_NetworkAdapterConfiguration
Win32_NetworkAdapterSetting
Win32_NetworkClient
Win32_NetworkConnection
Win32_NetworkLoginProfile
Win32_NetworkProtocol
Win32_NTEventlogFile
Win32_NTLogEvent
Win32_NTLogEventComputer
Win32_NTLogEventLog
Win32_NTLogEventUser
Win32_ODBCAttribute
Win32_ODBCDataSourceAttribute
Win32_ODBCDataSourceSpecification
Win32_ODBCDriverAttribute
Win32_ODBCDriverSoftwareElement
Win32_ODBCDriverSpecification
Win32_ODBCSourceAttribute
Win32_ODBCTranslatorSpecification
Win32_OnBoardDevice
Win32_OperatingSystem
Win32_OperatingSystemQFE
Win32_OSRecoveryConfiguration
Win32_PageFile
Win32_PageFileElementSetting
Win32_PageFileSetting
Win32_PageFileUsage
Win32_ParallelPort
Win32_Patch
Win32_PatchFile
Win32_PatchPackage
Win32_PCMCIAController
Win32_Perf
Win32_PerfRawData
Win32_PerfRawData_ASP_ActiveServerPages
Win32_PerfRawData_ASPNET_114322_ASPNETAppsv114322
Win32_PerfRawData_ASPNET_114322_ASPNETv114322
Win32_PerfRawData_ASPNET_ASPNET
Win32_PerfRawData_ASPNET_ASPNETApplications
Win32_PerfRawData_IAS_IASAccountingClients
Win32_PerfRawData_IAS_IASAccountingServer
Win32_PerfRawData_IAS_IASAuthenticationClients
Win32_PerfRawData_IAS_IASAuthenticationServer
Win32_PerfRawData_InetInfo_InternetInformationServicesGlobal
Win32_PerfRawData_MSDTC_DistributedTransactionCoordinator
Win32_PerfRawData_MSFTPSVC_FTPService
Win32_PerfRawData_MSSQLSERVER_SQLServerAccessMethods
Win32_PerfRawData_MSSQLSERVER_SQLServerBackupDevice
Win32_PerfRawData_MSSQLSERVER_SQLServerBufferManager
Win32_PerfRawData_MSSQLSERVER_SQLServerBufferPartition
Win32_PerfRawData_MSSQLSERVER_SQLServerCacheManager
Win32_PerfRawData_MSSQLSERVER_SQLServerDatabases
Win32_PerfRawData_MSSQLSERVER_SQLServerGeneralStatistics
Win32_PerfRawData_MSSQLSERVER_SQLServerLatches
Win32_PerfRawData_MSSQLSERVER_SQLServerLocks
Win32_PerfRawData_MSSQLSERVER_SQLServerMemoryManager
Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationAgents
Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationDist
Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationLogreader
Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationMerge
Win32_PerfRawData_MSSQLSERVER_SQLServerReplicationSnapshot
Win32_PerfRawData_MSSQLSERVER_SQLServerSQLStatistics
Win32_PerfRawData_MSSQLSERVER_SQLServerUserSettable
Win32_PerfRawData_NETFramework_NETCLRExceptions
Win32_PerfRawData_NETFramework_NETCLRInterop
Win32_PerfRawData_NETFramework_NETCLRJit
Win32_PerfRawData_NETFramework_NETCLRLoading
Win32_PerfRawData_NETFramework_NETCLRLocksAndThreads
Win32_PerfRawData_NETFramework_NETCLRMemory
Win32_PerfRawData_NETFramework_NETCLRRemoting
Win32_PerfRawData_NETFramework_NETCLRSecurity
Win32_PerfRawData_Outlook_Outlook
Win32_PerfRawData_PerfDisk_PhysicalDisk
Win32_PerfRawData_PerfNet_Browser
Win32_PerfRawData_PerfNet_Redirector
Win32_PerfRawData_PerfNet_Server
Win32_PerfRawData_PerfNet_ServerWorkQueues
Win32_PerfRawData_PerfOS_Cache
Win32_PerfRawData_PerfOS_Memory
Win32_PerfRawData_PerfOS_Objects
Win32_PerfRawData_PerfOS_PagingFile
Win32_PerfRawData_PerfOS_Processor
Win32_PerfRawData_PerfOS_System
Win32_PerfRawData_PerfProc_FullImage_Costly
Win32_PerfRawData_PerfProc_Image_Costly
Win32_PerfRawData_PerfProc_JobObject
Win32_PerfRawData_PerfProc_JobObjectDetails
Win32_PerfRawData_PerfProc_Process
Win32_PerfRawData_PerfProc_ProcessAddressSpace_Costly
Win32_PerfRawData_PerfProc_Thread
Win32_PerfRawData_PerfProc_ThreadDetails_Costly
Win32_PerfRawData_RemoteAccess_RASPort
Win32_PerfRawData_RemoteAccess_RASTotal
Win32_PerfRawData_RSVP_ACSPerRSVPService
Win32_PerfRawData_Spooler_PrintQueue
Win32_PerfRawData_TapiSrv_Telephony
Win32_PerfRawData_Tcpip_ICMP
Win32_PerfRawData_Tcpip_IP
Win32_PerfRawData_Tcpip_NBTConnection
Win32_PerfRawData_Tcpip_NetworkInterface
Win32_PerfRawData_Tcpip_TCP
Win32_PerfRawData_Tcpip_UDP
Win32_PerfRawData_W3SVC_WebService
Win32_PhysicalMemory
Win32_PhysicalMemoryArray
Win32_PhysicalMemoryLocation
Win32_PNPAllocatedResource
Win32_PnPDevice
Win32_PnPEntity
Win32_PointingDevice
Win32_PortableBattery
Win32_PortConnector
Win32_PortResource
Win32_POTSModem
Win32_POTSModemToSerialPort
Win32_PowerManagementEvent
Win32_Printer
Win32_PrinterConfiguration
Win32_PrinterController
Win32_PrinterDriverDll
Win32_PrinterSetting
Win32_PrinterShare
Win32_PrintJob
Win32_PrivilegesStatus
Win32_Process
Win32_Processor
Win32_ProcessStartup
Win32_Product
Win32_ProductCheck
Win32_ProductResource
Win32_ProductSoftwareFeatures
Win32_ProgIDSpecification
Win32_ProgramGroup
Win32_ProgramGroupContents
Win32_ProgramGroupOrItem
Win32_Property
Win32_ProtocolBinding
Win32_PublishComponentAction
Win32_QuickFixEngineering
Win32_Refrigeration
Win32_Registry
Win32_RegistryAction
Win32_RemoveFileAction
Win32_RemoveIniAction
Win32_ReserveCost
Win32_ScheduledJob
Win32_SCSIController
Win32_SCSIControllerDevice
Win32_SecurityDescriptor
Win32_SecuritySetting
Win32_SecuritySettingAccess
Win32_SecuritySettingAuditing
Win32_SecuritySettingGroup
Win32_SecuritySettingOfLogicalFile
Win32_SecuritySettingOfLogicalShare
Win32_SecuritySettingOfObject
Win32_SecuritySettingOwner
Win32_SelfRegModuleAction
Win32_SerialPort
Win32_SerialPortConfiguration
Win32_SerialPortSetting
Win32_Service
Win32_ServiceControl
Win32_ServiceSpecification
Win32_ServiceSpecificationService
Win32_SettingCheck
Win32_Share
Win32_ShareToDirectory
Win32_ShortcutAction
Win32_ShortcutFile
Win32_ShortcutSAP
Win32_SID
Win32_SMBIOSMemory
Win32_SoftwareElement
Win32_SoftwareElementAction
Win32_SoftwareElementCheck
Win32_SoftwareElementCondition
Win32_SoftwareElementResource
Win32_SoftwareFeature
Win32_SoftwareFeatureAction
Win32_SoftwareFeatureCheck
Win32_SoftwareFeatureParent
Win32_SoftwareFeatureSoftwareElements
Win32_SoundDevice
Win32_StartupCommand
Win32_SubDirectory
Win32_SystemAccount
Win32_SystemBIOS
Win32_SystemBootConfiguration
Win32_SystemDesktop
Win32_SystemDevices
Win32_SystemDriver
Win32_SystemDriverPNPEntity
Win32_SystemEnclosure
Win32_SystemLoadOrderGroups
Win32_SystemLogicalMemoryConfiguration
Win32_SystemMemoryResource
Win32_SystemNetworkConnections
Win32_SystemOperatingSystem
Win32_SystemPartitions
Win32_SystemProcesses
Win32_SystemProgramGroups
Win32_SystemResources
Win32_SystemServices
Win32_SystemSetting
Win32_SystemSlot
Win32_SystemSystemDriver
Win32_SystemTimeZone
Win32_SystemUsers
Win32_TapeDrive
Win32_TemperatureProbe
Win32_Thread
Win32_TimeZone
Win32_Trustee
Win32_TypeLibraryAction
Win32_UninterruptiblePowerSupply
Win32_USBController
Win32_USBControllerDevice
Win32_UserAccount
Win32_UserDesktop
Win32_VideoConfiguration
Win32_VideoController
Win32_VideoSettings
Win32_VoltageProbe
Win32_WMIElementSetting
Win32_WMISetting