本文整理自网络,侵删。
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 stringgrid 实例5 本例功能:字体修改为居中,红色,20号
Delphi研究之驱动开发篇(六)--利用section与用户模式程序通讯(上)
更多相关阅读请进入《Delphi》频道 >>