检测如果Windows防火墙阻止我的计划 [英] Detect if windows firewall is blocking my program
问题描述
我有通过他们的API NetApp的设备进行通信的应用程序。随着Windows防火墙,API命令将失败。与防火墙关闭时,API命令工作。我没有收到类似Windows防火墙阻止该程序的任何消息。
I have an application that communicates with a NetApp device through their api. With the windows firewall on, the api commands will fail. With the firewall off, the api commands work. I don't receive any message like "Windows Firewall is blocking this program".
通过文档的样子,我相信,我发现需要是开放API命令工作的TCP端口。怎样才能当端口被阻止这样我就可以对潜在的问题显示一条消息给用户编程方式检测?
Looking through the documentation I believe that I found the TCP ports that need to be open for the api commands to work. How can I programatically detect if the ports are blocked so I can display a message to the user on the potential problem?
推荐答案
防火墙管理员通过COM公开本身并实现一个<一个href=\"http://msdn.microsoft.com/en-us/library/aa365290%28v=VS.85%29.aspx\"><$c$c>IsPortAllowed$c$c>,这里与管理者交互的互操作的例子。
The firewall manager exposes itself via COM and implements an IsPortAllowed
, here is an interop example of interacting with the manager.
这篇关于检测如果Windows防火墙阻止我的计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!