Created
July 23, 2012 05:41
-
-
Save sandrinodimattia/3162100 to your computer and use it in GitHub Desktop.
Windows Firewall (dynamic)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type fwMgrType = Type.GetTypeFromProgID("HNetCfg.FwMgr"); | |
dynamic fwMgr = Activator.CreateInstance(fwMgrType); | |
bool isFwEnabled = fwMgr.LocalPolicy.CurrentProfile.FirewallEnabled; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment