【问题标题】:How to make an application trusted?如何使应用程序可信?
【发布时间】:2012-02-04 03:39:44
【问题描述】:

或者换一种方式理解VB.NET中如何绕过Windows的防火墙?

【问题讨论】:

  • 您已经进行了哪些研究?谷歌发现了什么?
  • 绕过任何防火墙听起来都不是很安全。为什么需要?你只是想让你的程序提示用户允许吗?您只是想务实地添加规则吗?

标签: .net vb.net


【解决方案1】:

我找到了通过托管代码访问 Windows 防火墙 API 的指南。这将允许您在程序中自动打开和关闭端口,这是您要找的吗?

http://blogs.msdn.com/b/securitytools/archive/2009/08/21/automating-windows-firewall-settings-with-c.aspx

它专门给出了这个例子来将一个程序添加到受信任的程序列表中。

INetFwAuthorizedApplications applications; 
INetFwAuthorizedApplication application;
application.Name = “Internet Explorer”;/*set the name of the application */
application.ProcessImageFileName = "C:\\Program Files\\Internet Explorer\\iexplore.exe" /* set this property to the location of the executable file of the application*/
application.Enabled =  true; //enable it
/*now add this application to AuthorizedApplications collection */
Type NetFwMgrType = Type.GetTypeFromProgID("HNetCfg.FwMgr", false); 
INetFwMgr mgr = (INetFwMgr)Activator.CreateInstance(NetFwMgrType); 
applications = (INetFwAuthorizedApplications)mgr.LocalPolicy.CurrentProfile.AuthorizedApplications;
applications.Add(application);

根据评论编辑 基于 cmets,您真正想要查看的是代码签名。 http://en.wikipedia.org/wiki/Code_signing

这通常意味着购买证书(有点像 SSL)并将其应用于您编译的应用程序。这与为程序集赋予强名称的 .NET 签名不同,它是不同的。

【讨论】:

  • 不,我的意思是,当您在另一台计算机上启动程序时,防火墙会阻止它并说您正在从未经授权的发布者那里启动程序,您确定要这样做,然后单击“是”或者没有
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-07-09
  • 1970-01-01
  • 2014-01-07
  • 1970-01-01
相关资源
最近更新 更多