Determine operating system and processor type in C#

后端 未结 4 2005
谎友^
谎友^ 2021-02-05 21:03

I want to check what type of operating system i use and what kind of processor. this should be check on run time. i tried using

System.Environment.GetEnvironment         


        
4条回答
  •  Happy的楠姐
    2021-02-05 21:50

    Yes WMI is the best way to do this kind of stuff You can use this to retrieve OS informations :

    ManagementObjectSearcher objMOS = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM  Win32_OperatingSystem");
    

提交回复
热议问题