如何获取有关已安装的防病毒和防火墙的信息? [英] How to get information about installed antivirus and firewall?

查看:101
本文介绍了如何获取有关已安装的防病毒和防火墙的信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要找到有关Windows中安装了哪些防病毒和防火墙的信息.我找到了使用WMI类的解决方案,但我不能使用该类,因为最新版本的Windows已不再支持这两个类.最好从寄存器中获取此信息.我试图找到一些方法来做,但是我没有成功.或者,如果您知道如何使用API​​函数获取此信息,请在C#上编写任何示例.

I need to find information about what antivirus and firewall was installed in Windows. I found solutions with using WMI classes, but I can’t use that one, both classes are not supported any more in latest versions of Windows. It will be better to get this information from register. I try to find some ways to do it, but I have no success. Or if you know how to get this information using API functions, please, write any examples on C#.

推荐答案

对于Windows内置防火墙:http://msdn.microsoft.com/en-us/library/aa364726%28VS.85% 29.aspx [ ^ ]

对于其他所有内容,我建议您使用此处的代码 http: //www.howtogeek.com/howto/programming/get-a-list-of-running-processes-in-c/ [
For the windows built-in firewall: http://msdn.microsoft.com/en-us/library/aa364726%28VS.85%29.aspx[^]

For everything else I would suggest using the code found here http://www.howtogeek.com/howto/programming/get-a-list-of-running-processes-in-c/[^] to obtain a list of active process and then using a List of known process that belong to certain AV/FW vendors to determine what is running. I would also suggest you look for active services also.


''这是使用VB脚本编写的内容


''This is writtne using VB Script


strComputer = "." 'Can set to remote machine.

dim colItems, objItem

On Error Resume Next
Set oWMI = GetObject _
      ("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer _
     & "\root\SecurityCenter")

strText=strText & vbCrLF & vbCrLf & "Antivirus Information" & vbCrLf
Set colItems = oWMI.ExecQuery("Select * from AntiVirusProduct")
for each objItem in colItems
    strText=strText & "------------------------------------------------------" & vbCrLf
    strText=strText & "companyName: " & objItem.companyName & vbCrLf
    strText=strText & "displayName: " & objItem.displayName & vbCrLf
'    strText=strText & "instanceGuid: " & objItem.instanceGuid & vbCrLf
    strText=strText & "onAccessScanningEnabled: "
    strText=strText & objItem.onAccessScanningEnabled  & vbCrLf
    strText=strText & "productUptoDate: " & objItem.productUptoDate & vbCrLf
    strText=strText & "versionNumber: " & objItem.versionNumber & vbCrLf
    strText=strText & "------------------------------------------------------" & vbCrLf
next
WScript.echo strText


这篇关于如何获取有关已安装的防病毒和防火墙的信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆