언급 한대로 WMC를 사용하여 here 샘플을 찾을 수 있습니다. 이 포스터에는 이것이 Win 7 머신에서 수행되고 있다고 나와 있습니다. 아래 코드는 시작해야합니다 ...
ConnectionOptions _connectionOptions = new ConnectionOptions();
//Not required while checking it in local machine.
//For remote machines you need to provide the credentials
//options.Username = "";
//options.Password = "";
_connectionOptions.EnablePrivileges = true;
_connectionOptions.Impersonation = ImpersonationLevel.Impersonate;
//Connecting to SecurityCenter2 node for querying security details
ManagementScope _managementScope = new ManagementScope(string.Format("\\\\{0}\\root\\SecurityCenter2", ipAddress), _connectionOptions);
_managementScope.Connect();
//Querying
ObjectQuery _objectQuery = new ObjectQuery("SELECT * FROM AntivirusProduct");
ManagementObjectSearcher _managementObjectSearcher =
new ManagementObjectSearcher(_managementScope, _objectQuery);
ManagementObjectCollection _managementObjectCollection = _managementObjectSearcher.Get();
if (_managementObjectCollection.Count > 0)
{
foreach (ManagementObject item in _managementObjectCollection)
{
Console.WriteLine(item["displayName"]);
//For Kaspersky AntiVirus, I am getting a null reference here.
//Console.WriteLine(item["productUptoDate"]);
//If the value of ProductState is 266240 or 262144, its an updated one.
Console.WriteLine(item["productState"]);
}
}
감사합니다. 그것은 내가 원래 혼란스러워했던 productState였습니다. 이 답변을 통해 http://www.neophob.com/2010/03/wmi-query-windows-securitycenter2/를 통해 제품 상태에 대한 더 많은 정보를 얻으실 수 있습니다. 또한 securityCenter2는 Vista SP1 이상을 제공합니다. –
쿼리, Windows 7에서 최신 바이러스 백신 기능을 사용할 수 있습니까 ?? @Aaron McIver – TechBrkTru