Deploying NetFwTypeLib to manage the Windows Firewall

后端 未结 3 1958
死守一世寂寞
死守一世寂寞 2020-12-19 03:27

My Windows service needs to create/remove certain rules from the Windows firewall. For this I interface with NetFwTypeLib in \\system32\\hn

3条回答
  •  孤城傲影
    2020-12-19 04:13

    NetFwTypeLib object doesn't reside in hnetcfg.dll library on Windows 7 Ultimate. Rather, it resides in FirewallAPI.dll at %system32%\FirewallAPI.dll (eg c:\windows\system32\FirewallAPI.dll).

    using NetFwTypeLib; // Add reference %SystemRoot%\System32\FirewallAPI.dll

提交回复
热议问题