procedure TForm1.Button1Click(Sender: TObject);
var
  FwMgr,Profile,FwApp: variant;
begin
  FwMgr := CreateOLEObject('HNetCfg.FwMgr');
  Profile := FwMgr.LocalPolicy.CurrentProfile;
  FwApp := CreateOLEObject('HNetCfg.FwAuthorizedApplication');
  FwApp.Name :='我的测试'; //显示名字
  FwApp.ProcessImageFileName := Application.ExeName; //要通过的程序
  FwApp.Enabled  := true;
  Profile.AuthorizedApplications.Add(FwApp);
end;

这样,你的软件就能通过XP的防火墙了,不会再有拦截提示了
本文来自Delphi之窗,原文地址:http://www.52delphi.com

相关文章:

  • 2021-09-02
  • 2021-11-22
  • 2021-11-17
  • 2021-11-24
  • 2022-12-23
  • 2021-09-29
  • 2022-12-23
  • 2021-08-29
猜你喜欢
  • 2021-12-16
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2022-03-08
  • 2021-04-07
  • 2021-12-02
相关资源
相似解决方案