本文整理自网络,侵删。
function ControlIIS(const strAction:string='restart'):Boolean;//参数 /restart 停止并重起所有INTERNET服务// /start 启动所有INTERNET 服务// /stop 停止所有INTERNET服务// /reboot 重起计算机// /Status 显示所有INTERNET服务状态等等var sCmd:string;begin sCmd:='IISReset/'+strAction; try WinExec(pchar(sCmd),SW_HIDE); //ShellExecute(handle,'open',pchar(sCmd),'-s',' ',SW_HIDE); Result := True; except //messagedlg('执行失败',mtinformation,[mbok],0); Result := False; end;end;
http://blog.csdn.net/xieyunc/article/details/4142896
相关阅读 >>
Delphi dateutils.ispm - 判断时间是否是下午
Delphi2010新功能:tdirectory.getfiles 支持通配符
Delphi 取得开机时间 开机时间总长度(可精确到秒,分钟等)
Delphi 如何在tmemo,tedit或trichedit中获得插入符的位置
Delphi serial number of an usb flash drive 获取u盘硬件序列号
Delphi unigi unidbtreegrid展开叠起 unidbgrid自动调节列宽
更多相关阅读请进入《Delphi》频道 >>