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的防火墙了,不会再有拦截提示了!
本文介绍了一种通过编程方式将指定应用程序添加到Windows XP防火墙授权列表的方法,从而避免防火墙对这些应用进行拦截提示。

868

被折叠的 条评论
为什么被折叠?



