chucklu

Programmatically add an application to Windows Firewall

回答1

 

Not sure if this is the best way, but running netsh should work:

netsh firewall add allowedprogram C:\MyApp\MyApp.exe MyApp ENABLE

I think this requires Administrator Permissions though,for obvious reasons :)

Edit: I just don't know enough about ClickOnce to know whether or not you can run external programs through it.

 

 

回答2

I found this article, which has a complete wrapper class included for manipulating the windows firewall. Adding an Application to the Exception list on the Windows Firewall

http://web.archive.org/web/20070707110141/http://www.dot.net.nz/Default.aspx?tabid=42&mid=404&ctl=Details&ItemID=8

 

 

 

 

 

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-01-28
  • 2021-04-02
  • 2021-08-24
  • 2022-12-23
  • 2021-06-26
  • 2021-09-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案