Quote Originally Posted by Chris_F View Post
I don't see what the problem is. Use [DllImport("FirewallAPI.dll")] ... and [DllImport("hnetcfg.dll")] ...

and use System.Environment.OSVersion.Version.Major to figure out which function to call.
Chris, actually I found out that "FirewallAPI.dll" can in fact be used in XP and older OS as well. It is "hnetcfg.dll" that causes the problem in Vista.

But yeah, your method is also great specially in other cases where you hve to use two dll's. Thanks.