孤独的猫

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

procedure SetIISDir(Dir,BieMing:string);

var

I:IADSContainer;

ADS:IADS;

begin

if ADSGetObject('IIS://localhost/w3svc',IID_IADSContainer,IUnkown(I))=S_OK then

begin

ADS :=IADS(I.GetObject('IISWebServer','1'));

if ADS.QueryInterface(IID_IADSContainer,I)=S_OK) then

begin

ADS :=IADS(I.GetObject('IISWebVirtualDir','Root');

if ADS.QueryInterface(IID_IADSContainer,I)=S_OK) then

begin

ADS :=IADS(I.Create('IISWebVirtualDir',BieMing));

ADS.Put('AccessRead','True');

ADS.Put('Path',Dir);

ADS.SetInfo;

end;

end;

end;

posted on 2008-09-14 14:09  孤独的猫  阅读(185)  评论(0编辑  收藏  举报