Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created July 23, 2012 05:41
Show Gist options
  • Save sandrinodimattia/3162100 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/3162100 to your computer and use it in GitHub Desktop.
Windows Firewall (dynamic)
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