下载本文示例代码
先引入类型库(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虚拟目录
阅读(149) | 评论(0) | 转发(0) |