delphi开启和关闭Windows xp 防火墙


本文整理自网络,侵删。

  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 实现简易语音发音(基于tts方式)

Delphi memo 文本列合并

Delphi判断某一个点是否在一个区域内

Delphi 多次改变 richedit.text部份文本的颜色后,出现所有字体都变色的的解决办法

Delphi firedac 的recordcount 相关测试 记录

Delphi根据不同分隔符获取字符串内容

Delphi代码中嵌入汇编asm代码

Delphi 文字的高度与宽度: canvas.textextent

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...