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

Programmatically add an application to Windows Firewall的更多相关文章

  1. [Windows Azure] Adding Sign-On to Your Web Application Using Windows Azure AD

    Adding Sign-On to Your Web Application Using Windows Azure AD 14 out of 19 rated this helpful - Rate ...

  2. win7防火墙打不开(无法启动windows firewall服务)

    点击windows 7控制面板中防火墙的“推荐配置”没有反应:打开“服务”,无法启动windows firewall,并报错.  可能很多的win7用户都碰到过这样的一种情况,那就是win7的防火墙打 ...

  3. How to Programmatically Add/Delete Custom Options in Magento? - See more at: http://apptha.com/blog/

    In this tutorial, I would like to help out Magento developers and clients with how to programmatical ...

  4. windows defender和windows firewall

    Windows defender: Windows Defender,曾用名Microsoft Anti Spyware,是一个杀毒程序,可以运行在Windows XP和Windows Server ...

  5. 关掉Windows Firewall的PowerShell

    在Windows 8或Windows 2012 R2上, 使用下面的命令: Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled ...

  6. SQL Server: Windows Firewall with Advanced Security

    SQL Database Engine: TCP 1433 & UDP 1434 SQL Analysis Service: TCP 2383 (2382 if named instance) ...

  7. Turn Off Windows Firewall Using PowerShell and CMD

    If you want to turn off the Windows Firewall, there are three methods. One is using the GUI which is ...

  8. [Windows] [Firewall] 增加进入规则

    netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP l ...

  9. No such application config! Please add dubbo:application

    SpringBoot运行找不到application.properties配置文件 运行springBoot项目启动报错:java.lang.IllegalStateException: No suc ...

随机推荐

  1. intellij idea 设置用真机测试android

    android自带的模拟器是不容置疑的慢,genymontion虽然快,但是觉得有点怪的感觉,哈哈,其实这些都不是重点. 之前是用myeclipse开发android的,虽然一直很想用eclipse来 ...

  2. ASP.NET Core中的Action的返回值类型

    在Asp.net Core之前所有的Action返回值都是ActionResult,Json(),File()等方法返回的都是ActionResult的子类.并且Core把MVC跟WebApi合并之后 ...

  3. cd命令使用

  4. R语言kohonen包主要函数介绍

    最近准备写一篇关于自组织映射 (Self-organizing map)的文章.SOM的代码很多,研究了一圈之后目前使用最顺手的是R语言的kohonen包. 这个kohonen包功能很丰富,但是接口不 ...

  5. niuke --abc

    链接:https://ac.nowcoder.com/acm/contest/1083/A来源:牛客网 给出一个字符串s,你需要做的是统计s中子串”abc”的个数.子串的定义就是存在任意下标a< ...

  6. 深入理解Java线程状态转移

    目录 前言 状态转移图 1.0 新建态到就绪态 1.1 就绪态到运行态 1.2 运行态到就绪态 1.2.1 时间片用完 1.2.2 t1.yield() .Thread.yield(); 1.3 运行 ...

  7. VMware15 安装Mac 10.14系统/苹果系统

    安装环境 Windows专业版 VMware Workstation Pro 15 所需资源 VMware Workstation Pro 15.0.0 Build 10134415 官网下载地址:h ...

  8. BUUOJ [BJDCTF 2nd]elementmaster

    [BJDCTF 2nd]elementmaster 进来就是这样的一个界面,然后就查看源代码 转换之后是Po.php,尝试在URL之后加上看看,出现了一个“.“ ....... 迷惑 然后看了wp 化 ...

  9. sqli lab 1-4

    less-1 爆库 id=1222' union select 1,group_concat(schema_name),database() from information_schema.schem ...

  10. PHP 新特性:如何善用接口与Trait

    首先! 接口也可以继承,通过使用 extends 操作符. 案例: <?php interface a { public function foo(); } interface b extend ...