C#-如何启用外部防火墙? [英] C# - How to chceck if external firewall is enabled?

查看:134
本文介绍了C#-如何启用外部防火墙?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们要使用Cisco NAC,并且需要检查客户端桌面是否安装了防火墙.这可能不是默认的Windows防火墙.

We want to use Cisco NAC and need to check if client Desktop has a firewall installed. This may be not the default Windows Firewall.

是否有一些可以检查的Windows注册表项?

Is there some Windows registry key that can be checked?

推荐答案

对于非Windows防火墙,可以使用

For non-Windows firewalls, you can use WMI API to detect the presence of a firewall if it's registered with Windows.

Namespace = "Root\SecurityCenter2"  (might be "Root\SecurityCenter" on pre-vista)
Query = "SELECT * From FirewallProduct"

您可以使用此小宝石进行检测如果它实际上是打开还是关闭.

And you can use this little gem to detect if it's actually on or off.

对于Windows防火墙检测,它是 INetFwMgr和朋友.

For Windows Firewall detection, it's INetFwMgr and friends.

这篇关于C#-如何启用外部防火墙?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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