当前位置:网站首页>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
边栏推荐
- bracket matching
- Oreo domain name authorization verification system v1.0.6 public open source version website source code
- Feign 与 OpenFeign
- 顺序队列
- 数据仓库(1)什么是数据仓库,数仓有什么特点
- visual studio 2015 warning MSB3246
- 腾讯云胡启明:Kubernetes云上资源的分析与优化
- 知识分享|如何设计有效的帮助中心,不妨来看看以下几点
- 文章复现:超分辨率网络-VDSR
- jekyll adds a flowchart to the blog
猜你喜欢
【一起学Rust | 进阶篇 | Service Manager库】Rust专用跨平台服务管理库
经验分享|盘点企业进行知识管理时的困惑类型
漫画 | 老板裁掉我两周后,又把我请回去,工资翻番!
使用堡塔应用管理器配置laravel队列方法
[Teach you to use the serial port idle interrupt of the STM32HAL library]
Tear down the underlying mechanism of the five JOINs of SparkSQL
[TypeScript] In-depth study of TypeScript enumeration
推荐系统_刘老师
After the tester with 10 years of service "naked resignation" from the big factory...
Uniapp微信雪糕刺客单页小程序源码
随机推荐
Uniapp微信雪糕刺客单页小程序源码
链栈的应用
After encountering MapStruct, the conversion between PO, DTO and VO objects is no longer handwritten
STP基本配置及802.1D生成树协议的改进
How to carry out AI business diagnosis and quickly identify growth points for cost reduction and efficiency improvement?
adb控制常用命令
ts集成和使用
工龄10年的测试员从大厂“裸辞”后...
伺服电机矢量控制原理与仿真(1)控制系统的建立
dotnet 删除只读文件
[Data Mining] Written Exam Questions for Sohu Data Mining Engineers
88.(cesium之家)cesium聚合图
After the tester with 10 years of service "naked resignation" from the big factory...
88. (the home of cesium) cesium polymerization figure
漫画 | 老板裁掉我两周后,又把我请回去,工资翻番!
3、IO流之字节流和字符流
idea2021版本添加上一步和下一步操作到工具栏
MySQL字段类型
【Programming Ideas】
【2022杭电多校5 1012题 Buy Figurines】STL的运用