我想知道上次访问该软件是什么时候?我尝试使用LastUse
Win32_SoftwareFeature 的属性。但它返回奇怪的值(不是日期)。这是我使用的代码:
string temp;
string date;
ManagementObjectSearcher mos = new ManagementObjectSearcher("SELECT * FROM Win32_SoftwareFeature");
foreach (ManagementObject mo in mos.Get())
{
if (mo["Name"] != null)
{
temp = mo["Name"].ToString() +" Version " +mo["Version"].ToString();
lstTest.Items.Add(temp);
date = mo["LastUse"].ToString();
}
else
{
break;
}
}