小编All*_*des的帖子

添加到防火墙例外列表

我在下面提到了将我的应用程序添加到Windows防火墙例外列表的代码.我想知道这是否也适用于其他防火墙,例如:防病毒防火墙等.如果没有,请提出解决方案.注意:我的应用程序正在运行管理员权限,但我的用户无法理解快速等等的防火墙设置.我使用Delphi 2007(Win32).

这是我第一次使用这个论坛.请原谅+纠正任何错误.

关心艾伦费尔南德斯

procedure AddApplicationToFirewall(EntryName:string;ApplicationPathAndExe:string);
var
  fwMgr,app:OleVariant;
  profile:OleVariant;
begin
  fwMgr := CreateOLEObject('HNetCfg.FwMgr');
  profile := fwMgr.LocalPolicy.CurrentProfile;
  app := CreateOLEObject('HNetCfg.FwAuthorizedApplication');
  app.ProcessImageFileName := ApplicationPathAndExe;
  app.Name := EntryName;
  app.Scope := NET_FW_SCOPE_ALL;
  app.IpVersion := NET_FW_IP_VERSION_ANY;
  app.Enabled :=true;
  profile.AuthorizedApplications.Add(app);
end;
Run Code Online (Sandbox Code Playgroud)

windows delphi security firewall

4
推荐指数
1
解决办法
3457
查看次数

标签 统计

delphi ×1

firewall ×1

security ×1

windows ×1