|
-
April 28th, 2010, 09:08 PM
#8
Re: Register an EXE as a Windows Firewall exception using C# code
 Originally Posted by Chris_F
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|