当前位置:网站首页>Dotnet using WMI software acquisition system installation
Dotnet using WMI software acquisition system installation
2022-08-04 20:56:00 【Lin Dexi】
This article tells you how to get the software installed by the system through WMI, this method cannot get all the software
The software installed by the system can be obtained through Win32_Product
var mc = "Win32_Product";var managementObject = new[]{"Caption","Description","IdentifyingNumber","InstallDate","InstallLocation","HelpLink","HelpTelephone","InstallSource","Language","LocalPackage","Name","PackageCache","PackageCode","PackageName","ProductID","RegOwner","RegCompany","SKUNumber","Transforms","URLInfoAbout","URLUpdateInfo","Vendor","WordCount","Version",};ManagementClass managementClass = new ManagementClass(mc);ManagementObjectCollection managementObjectCollection = managementClass.GetInstances();var str = new StringBuilder();foreach (ManagementObject m in managementObjectCollection){foreach (var temp in managementObject){try{str.Append(temp);str.Append(" ");str.Append(m[temp]?.ToString() ?? "");str.Append("\n");}catch (Exception e){Console.WriteLine(temp + " " + e);}}str.Append("\n");}return str.ToString();Output the content of str
Caption : Nut CloudDescription : Nut CloudIdentifyingNumber : {FEA8B01C-3F43-470A-BB28-679B1AEEC6E8}InstallDate : 20180305InstallLocation : C:\Program Files\Nutstore\HelpLink : http://help.jianguoyun.comHelpTelephone :InstallSource : C:\Users\linde\AppData\Roaming\NutstoreClient\install\AEEC6E8\Language : 2052LocalPackage : C:\WINDOWS\Installer\4acb3a9.msiName : Nut CloudPackageCache : C:\WINDOWS\Installer\4acb3a9.msiPackageCode : {3802EFD2-0953-4527-835E-E4C459062CD5}PackageName : Nutstore.x64.msiProductID :RegOwner :RegCompany :SKUNumber :Transforms : C:\WINDOWS\Installer\{FEA8B01C-3F43-470A-BB28-679B1AEEC6E8}\Nutstore.mstURLInfoAbout : https://www.jianguoyun.com/URLUpdateInfo :Vendor : Shanghai Yicun Network Technology Co., Ltd.WordCount : 0Version : 4.0.8Caption : Apple Application Support (32-bit)Description : Apple Application Support (32-bit)IdentifyingNumber : {5A659BE5-849B-484E-A83B-DCB78407F3A4}InstallDate : 20190221InstallLocation : C:\Program Files (x86)\Common Files\Apple\Apple Application SupportHelpLink : http://www.apple.com/cn/support/HelpTelephone: (86) 800 810 2323InstallSource : C:\Users\linde\AppData\Local\Temp\IXP246.TMP\Language : 2052LocalPackage : C:\WINDOWS\Installer\1a1ef7b.msiName : Apple Application Support (32-bit)PackageCache : C:\WINDOWS\Installer\1a1ef7b.msiPackageCode : {F3D0B996-B6DB-4283-9565-004518A6610B}PackageName : AppleApplicationSupport.msiProductID :RegOwner :RegCompany :SKUNumber :Transforms :URLInfoAbout : http://www.apple.com/en/URLUpdateInfo : http://www.apple.com/cn/Vendor : Apple Inc.WordCount : 0Version : 7.3边栏推荐
猜你喜欢
随机推荐
拒绝服务攻击DDoS介绍与防范
QT(41)-多线程-QTThread-同步QSemaphore-互斥QMutex
Common methods of js's new Function()
adb控制常用命令
【随记】新一天搬砖 --20220727
STP --- 生成树协议
Web3时代的战争
3、IO流之字节流和字符流
DICOM医学影像协议
How to train a deep learning model?
【AGC】构建服务1-云函数示例
Zero-knowledge proof notes - private transaction, pederson, interval proof, proof of ownership
2、字符集-编码-解码
帝国CMS仿核弹头H5小游戏模板/92game帝国CMS内核仿游戏网整站源码
MySQL field type
Using Baidu EasyDL to realize forest fire early warning and identification
MySQL字段类型
88.(cesium之家)cesium聚合图
STP基本配置及802.1D生成树协议的改进
Cryptography Series: PEM and PKCS7, PKCS8, PKCS12









