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 x秒生成大量垃圾字符

解决 Delphi 程序在不同操作系统中 shellexecute 调用 chrome.exe 偶尔无效的问题

Delphi获取系统字体列表

Delphi combobox 只读 text属性可用的方法

Delphi控制程序在任务栏显示与隐藏

Delphi fmx 把内容复制到粘贴板上支持跨平台

Delphi 动态修改显示器分辨率

Delphi里参数修饰符const、var、out的作用分别是什么?

Delphi idsmtp发送邮件

Delphi 汉字与区位码

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



打赏

取消

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

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

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

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

评论

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