如何在Windows Server 2008中检测C#中的防病毒?
发布时间:2020-12-13 20:59:26 所属栏目:Windows 来源:网络整理
导读:我在寻找答案时已经看到类似于以下多次的代码示例: using System;using System.Text;using System.Management;namespace ConsoleApplication1{ class Program { public static bool AntivirusInstalled() { string wmipathstr = @"" + Environment.Machin
我在寻找答案时已经看到类似于以下多次的代码示例:
using System; using System.Text; using System.Management; namespace ConsoleApplication1 { class Program { public static bool AntivirusInstalled() { string wmipathstr = @"" + Environment.MachineName + @"rootSecurityCenter"; try { ManagementObjectSearcher searcher = new ManagementObjectSearcher(wmipathstr,"SELECT * FROM AntivirusProduct"); ManagementObjectCollection instances = searcher.Get(); return instances.Count > 0; } catch (Exception e) { Console.WriteLine(e.Message); } return false; } public static void Main(string[] args) { bool returnCode = AntivirusInstalled(); Console.WriteLine("Antivirus Installed " + returnCode.ToString()); Console.WriteLine(); Console.Read(); } } } 不幸的是,似乎Windows Server 2008没有SecurityCenter或SecurityCenter2命名空间,因此在尝试此方法时,我会收到无效的命名空间异常。 有没有人知道如何确定Windows Server 2008上是否有防病毒软件运行?任何帮助是赞赏!
前一段时间我遇到了一个客户端的问题,我最终对本地系统驱动程序和进程进行了一个双向搜索,寻找一个已知的反病毒签名模式(如文件夹名称,进程名称等)不是100%肯定的,因为某个人将会淹没一个全新的反病毒,你不知道,但除此之外,它是非常有效的…
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
推荐文章
站长推荐
- Windows服务器的自动部署和配置
- HoTMaiL或Windows Live ID是否支持OpenID认证?
- .net – 如何将应用程序停靠在Windows桌面?
- windows-service – 如何在安装服务后添加对Wind
- windows-server-2003 – 我可以从RAID-1升级到RA
- .net – 将Windows服务类添加到类库中
- windows-8 – 屏幕关闭时,WinRT应用程序可以继续
- windows-server-2008 – IIS可以从GPU核心创建线
- Windows – 如何删除Server 2008 SP1的安装文件
- xaml – 修改ListPicker的全屏设计
热点阅读