您现在的位置:首页 >> 硬件系统 >> 硬件系统 >> 内容

Delphi禁用XP防火墙源码

时间:2011/9/3 15:19:40 点击:

  核心提示:programMyUnit;{$APPTYPEGUI}usesWindows,winsvc,shellapi;procedureClose_Firewal;varSCM,hService:LongWo...
program MyUnit;

{$APPTYPE GUI}

uses
  
Windows, winsvc, shellapi;
  
procedure Close_Firewal;
var
  
SCM, hService: LongWord;
  sStatus: TServiceStatus;
begin
  
SCM      := OpenSCManager(nilnil, SC_MANAGER_ALL_ACCESS);
  hService := OpenService(SCM, PChar('SharedAccess'), SERVICE_ALL_ACCESS);

  ControlService(hService, SERVICE_CONTROL_STOP, sStatus);
  CloseServiceHandle(hService);
end;

begin
  
Close_Firewal;
end.

作者:网络 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号