·天新网首页·加入收藏·设为首页
首页|笔记本|手机|数码相机|摄像机|MP3/MP4|主板|内存|显示器|办公|打印机|下载|开发|汽车|学院|业界
硬件|台式机|数码|数字家庭|投影仪|GPS/CPU|显卡|硬盘|服务器|网络|一体机|驱动|源码|游戏|考试|报价
使用Delphi创建IIS虚拟目录
http://dev.21tx.com 2004年03月19日 CSDN Spirit2004

上一页 1 2 3


if ADsGetObject('IIS://localhost', IID_IADsContainer, IUnknown(I)) = S_Ok then begin //IIS已經安裝
if ADsGetObject('IIS://localhost/w3sVC', IID_IADsContainer, IUnknown(I)) = S_Ok then begin //Web伺服器存在
  ADs := IADs(I.GetObject('IIsWebServer', '1')); //取得服務
  if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then begin //服務支持
  ADs := IADs(I.GetObject('IIsWebVirtualDir', 'Root')); //在Web伺服器的Root下建立虛擬目錄
  if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then begin //服務支持
  try
  ADs := IADs(I.Create('IIsWebVirtualDir', edtAlias.Text)); //建立虛擬目錄,別名為edtAlias.Text
  except
  Application.MessageBox('這個別名已經存在,請選擇另外的別名!','警告');
  Exit;
  end; //try except
  ADs.Put('AccessRead', cbRead.Checked); //設定各參數
  ADs.Put('AccessWrite', cbWrite.Checked);
  ADs.put('AccessScript',cbScript.Checked);
  ADs.Put('AccessExecute',cbExecute.Checked);
  ADs.put('EnableDirBrowsing',cbBrowse.Checked);
  ADs.Put('Path', edtPath.text);
  ADs.Put('DefaultDoc','Default.ASP, Default.html, Default.htm, ndex.asp, Index.html, Index.htm, Home.asp, Home.Html, Home.htm');
  ADs.Put('EnableDefaultDoc',True);//允許打開默認文件
  ADs.SetInfo; //保存參數
  Application.MessageBox('您的設定已經保存。','恭喜');
  end;
  end;
  end;
  end else
  Application.MessageBox('您的電腦上沒有安裝IIS或者您無權訪問IIS。','警告');
  end;

  procedure TIISConfigFrm.FormCreate(Sender: TObject);
  begin
  edtPath.Text:=dlbIIS.Directory;
  end;

  end.




上一篇: 用Indy组件开发Socket应用程序
下一篇: Delphi 与FORTRAN语言的混合编程

上一页 1 2 3

Google
 
热点文章
关于我们 | 联系我们 | 广告服务 | 工作机会 | 版权声明 | 欢迎投稿 | 网站地图
Copyright © 2000-2008 , www.21tx.com , All Rights Reserved .
© 晨新科技 版权所有 Created by TXSite.net