Şöyle bir procedure var ama çalışmıyor.
Kod: Tümünü seç
private
{ Private declarations }
fProfile : INetFwProfile;
procedure SetFireWallEnabled(const Value : Boolean);
Kod: Tümünü seç
procedure TForm1.SetFireWallEnabled(const Value: Boolean);
begin
if fProfile <> nil then
fProfile.FirewallEnabled := Value;
end;
Kod: Tümünü seç
procedure TForm1.Button2Click(Sender: TObject);
var
FireWall : INetFwMgr;
ExceptionList : INetFwAuthorizedApplications;
Collection : IEnumVariant;
tmp : OleVariant;
dummy : Cardinal;
begin
CoInitialize(nil);
FireWall := CreateOLEObject('HNetCfg.FwMgr') as INetFwMgr;
ExceptionList := FireWall.LocalPolicy.CurrentProfile.AuthorizedApplications;
Collection := ExceptionList._NewEnum as IEnumVariant;
while (Collection.Next(1, tmp, dummy) = S_OK) do
Mmo1.Lines.Add(tmp.Name + '->' + tmp.ProcessImageFileName + '->' + tmp.RemoteAddresses);
Collection := nil;
ExceptionList := nil;
FireWall := nil;
CoUnInitialize;
end;