开发者

How to get information of Publisher,InstalledON,Size information of the softwares installed in system

开发者 https://www.devze.com 2023-03-31 16:03 出处:网络
For getting the software names the below program is OK ManagementObjectSearcher mos = new ManagementObjectSearcher(\"SELECT * FROM Win32_Product\");

For getting the software names the below program is OK

ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_Product");

foreach (ManagementObject mo in mos.Get())
{
    Console.WriteLine(mo["Name"]);
    Console.WriteLine(开发者_运维技巧mo["Version"]);

}

 Console.ReadKey(true);

But what if I want to get Publisher,InstalledON,Size information of those softwares.. How can I get those?


try mo["InstallDate"] and mo["Vendor"] - I can't seem to find any Size but you could use mo["InstallLocation"] and add the size of its content up (for example using DirectoryInfo anf FileInfo)

0

精彩评论

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