本文整理自网络,侵删。
procedure Set_WindowsXP_FireWall(Enable: boolean);
// 需引用 winsvc, shellapi
// Set_WindowsXP_FireWall(false); // ?P?] Windows Xp 防火?? www.delphitop.com
//
var
SCM, hService: LongWord;
sStatus: TServiceStatus;
begin
if Enable = false then
begin
SCM := OpenSCManager(nil, nil, SC_MANAGER_ALL_ACCESS);
hService := OpenService(SCM, PChar('SharedAccess'), SERVICE_ALL_ACCESS);
ControlService(hService, SERVICE_CONTROL_STOP, sStatus);
CloseServiceHandle(hService);
end;
相关阅读 >>
Delphi Delphi copy,pos,delete win api 版
Delphi 解决idtcpclient和idtcpserver通信中文乱码问题
Delphi 多次改变 richedit.text部份文本的颜色后,出现所有字体都变色的的解决办法
Delphi firedac 的recordcount 相关测试 记录
Delphi 文字的高度与宽度: canvas.textextent
更多相关阅读请进入《Delphi》频道 >>