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. IdentityServer4 QuckStart 授权与自定义Claims

    最近在折腾IdentityServer4,为了简单,直接使用了官方给的QuickStart示例项目作为基础进行搭建.有一说一,为了保护一个API,感觉花费的时间比写一个API还要多. 本文基于ASP. ...

  2. Mac 下 brew 切换为国内源

    简介 Homebrew 是一款自由及开放源代码的软件包管理系统,用以简化 macOS 和 linux 系统上的软件安装过程.它拥有安装.卸载.更新.查看.搜索等很多实用的功能,通过简单的一条指令,就可 ...

  3. matlab计算LZ复杂度

    我这个计算得14通道,每个通道截取3000个数据得复杂度,最后将计算得出得数据存储到本地txt文档中 function LZC(data) % 计算一维信号的复杂度 % data时间序列 % lzc: ...

  4. 智能可视化搭建系统 Atom 服务架构演变

    作者:凹凸曼 - Manjiz Atom 是什么?Atom 是集结业内各色资深电商行业设计师,提供一站式专业智能页面和小程序设计服务的平台.经过 2 年紧凑迭代,项目越来越庞大,需求不断变更优化,内部 ...

  5. vue2.x学习笔记(二十)

    接着前面的内容:https://www.cnblogs.com/yanggb/p/12631279.html. 循环引用 递归组件 组件是可以在它们自己的模板中调用自身的,不过它们只能通过[name] ...

  6. [GitHub] 75+的 C# 数据结构和算法实现

    C#中标准数据结构和算法的即插即用类库项目 GitHub:https://github.com/aalhour/C-Sharp-Algorithms Watch: 307 Star: 3.4k For ...

  7. linux常用命令--打包和压缩文件

    bunzip2 file1.bz2 解压一个叫做 'file1.bz2'的文件 bzip2 file1 压缩一个叫做 'file1' 的文件 gunzip file1.gz 解压一个叫做 'file1 ...

  8. Liunx常用操作(一)-删除命令

    在linux命令行模式下,如何一次性快速删除一行刚刚输入的命令? 经常在命令行输入命令的时候,一段文字都需要删除,一个字段一个字段,比较耗费时间 以下提供一些命令,配合在一起操作,可以一定程度提高工作 ...

  9. react: typescript integrate withRouter

    define interface: export interface INav { nav: string } export interface IModuleItem { state?: strin ...

  10. PHP 构造方法 __construct()

    PHP 构造方法 __construct() PHP 构造方法 __construct() 允许在实例化一个类之前先执行构造方法. 构造方法 构造方法是类中的一个特殊方法.当使用 new 操作符创建一 ...