直接贴代码:
using System;
using System.Management;
namespace WMISelect {
class Program {
static void Main(string[] args) {
var officeSoftware = new ManagementObjectSearcher("SELECT ID, ApplicationId, PartialProductKey, LicenseIsAddon, Description, Name, OfflineInstallationId FROM SoftwareLicensingProduct where PartialProductKey <> null");
var result = officeSoftware.Get();
foreach (var item in result)
{
Console.WriteLine("Name:" + item.GetPropertyValue("Name"));
Console.WriteLine("ApplicationID:" + item.GetPropertyValue("ApplicationID"));
Console.WriteLine("Description:" + item.GetPropertyValue("Description"));
Console.WriteLine("ID:" + item.GetPropertyValue("ID"));
Console.WriteLine("LicenseIsAddon:" + item.GetPropertyValue("LicenseIsAddon"));
Console.WriteLine("OfflineInstallationId:" + item.GetPropertyValue("OfflineInstallationId"));
Console.WriteLine("PartialProductKey:" + item.GetPropertyValue("PartialProductKey"));
Console.WriteLine();
}
Console.ReadKey();
}
}
}
参考文档:http://cuzic.net/wmi-yard-0.10/WMI/OfficeSoftwareProtectionProduct.html
技术帝就是厉害,顶礼膜拜了
OvO
不明觉历。
路过支持下
膜拜技术帝
不能用来破解啊
贊哦!
菜鸟飘过
安装是受用