本文整理自网络,侵删。
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 判断目录是否存在,不存在则创建目录并打开,存在则直接打开
Delphi2010:把stringgrid数据保存到excel
更多相关阅读请进入《Delphi》频道 >>