Given - .Net 2.0 XP machine with SP2 and multiple network adapters
Is there an API that can be used to check if the network adapter is firewalled?
OneGuyInDC
Given - .Net 2.0 XP machine with SP2 and multiple network adapters
Is there an API that can be used to check if the network adapter is firewalled?
OneGuyInDC
It is not possible to know in general (e.g. if there is an external firewall) for the following reasons:
But there is an API for finding out if the Windows Firewall is enabled on a given network interface. You will need to use COM interop to get the INetFwProfile (for global firewall status) and INetSharingConfiguration (for a specific network interface) interfaces, and check INetFwProfile.FirewallEnabled and INetSharingConfiguration.InternetFirewallEnabled.
See http://msdn.microsoft.com/en-us/library/aa364717%28VS.85%29.aspx for links and for how to use these results to determine the effective firewall status. (It's written in terms of VBScript but should be translatable to C#.)