Chinaunix首页 | 论坛 | 博客
  • 博客访问: 14490417
  • 博文数量: 5645
  • 博客积分: 9880
  • 博客等级: 中将
  • 技术积分: 68081
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-28 13:35
文章分类

全部博文(5645)

文章存档

2008年(5645)

我的朋友

分类:

2008-04-28 20:48:59

下载本文示例代码
  先引入类型库(Project|Import Type Library)adsiis.dll、iisext.dll和activeds.tlb新建一个单元,声明。unit ActiveDs;interface function ADsGetObject(const PathName: WideString; const GUID: TGUID; out I: IUnknown): HRESULT; stdcall;implementation function ADsGetObject;   external 'activeds.dll' name 'ADsGetObject';end. 方法一(参照C )、var I: IADsContainer; ADs: IADs;begin if ADsGetObject('IIS://localhost/w3svc', IID_IADsContainer, IUnknown(I)) = S_Ok then begin  ADs := IADs(I.GetObject('IIsWebServer', '1'));  ShowMessage(ADs.ADsPath);  if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then  begin   ADs := IADs(I.GetObject('IIsWebVirtualDir', 'Root'));   ShowMessage(ADs.ADsPath);   if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then   begin    ADs := IADs(I.Create('IIsWebVirtualDir', 'DelphiTest'));    ADs.Put('AccessRead', 'True');    ADs.Put('Path', 'c:\Temp');    ADs.SetInfo;   end;  end; end;end;共2页。 1 2 8 :   先引入类型库(Project|Import Type Library)adsiis.dll、iisext.dll和activeds.tlb新建一个单元,声明。unit ActiveDs;interface function ADsGetObject(const PathName: WideString; const GUID: TGUID; out I: IUnknown): HRESULT; stdcall;implementation function ADsGetObject;   external 'activeds.dll' name 'ADsGetObject';end. 方法一(参照C )、var I: IADsContainer; ADs: IADs;begin if ADsGetObject('IIS://localhost/w3svc', IID_IADsContainer, IUnknown(I)) = S_Ok then begin  ADs := IADs(I.GetObject('IIsWebServer', '1'));  ShowMessage(ADs.ADsPath);  if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then  begin   ADs := IADs(I.GetObject('IIsWebVirtualDir', 'Root'));   ShowMessage(ADs.ADsPath);   if ADs.QueryInterface(IID_IADsContainer, I) = S_OK then   begin    ADs := IADs(I.Create('IIsWebVirtualDir', 'DelphiTest'));    ADs.Put('AccessRead', 'True');    ADs.Put('Path', 'c:\Temp');    ADs.SetInfo;   end;  end; end;end;共2页。 1 2 8 : 下载本文示例代码


Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录Delphi中用Adsi创建IIS虚拟目录
阅读(145) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~