如何使一个应用程序是否可信?可信、应用程序

2023-09-04 04:26:55 作者:╰つ宝宝金水

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

Or in another way of understanding how to bypass the firewall of Windows in VB.NET?

推荐答案

我认为该指南通过管理code访问Windows防火墙API。这将允许你从withing程序自动打开和关闭端口,是你在找什么呢?

I found this guide to accessing the Windows Firewall API via managed code. This will allow you to open and close ports automatically from withing your program, is that what you are looking for?

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

它明确给出了这样的例子,添加一个程序到受信任程序列表。

It specifically gives this example to adding a program to the trusted programs list.

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);

基于注释

修改 根据意见,它看起来像你真的想看看是code签名。 http://en.wikipedia.org/wiki/$c$c_signing

Edit Based on Comments Based on comments it looks like what you really want to look at is Code Signing. http://en.wikipedia.org/wiki/Code_signing

这通常意味着购买证书(有点像SSL),并将它应用到你的编译的应用程序。这是不一样的。NET的签约也就是给予一个集强名称的一部分,这是不同的东西。

This usually means buying a certificate (kind of like SSL) and applying it to your compiled application. This is not the same as .NET's signing that is part of giving an assembly a strong name, it's something different.