Q
qdyoung
Unregistered / Unconfirmed
GUEST, unregistred user!
' 以下是VBS代码:
dim websvc, site, root, dir
set websvc = GetObject("IIS://localhost/W3svc"
set site = websvc.GetObject("IIsWebServer", "1"
set root = site.GetObject("IISWebVirtualDir", "Root"
for each dir in root
if dir.class = "IIsWebVirtualDir" then
MsgBox dir.Name + "=" + dir.Path
end if
next
// 以下是Delphi代码,就是VBS的for each部分不知Delphi的如何写?
procedure GetIISWebVirtualDirList(AList: TStrings);
var
WebSite, WebService, WebServer, WebRoot: Variant;
begin
AList.Clear;
WebSite := CreateOleObject('IISNamespace');
WebService := WebSite.GetObject('IISWebService', 'localhost/w3svc');
WebServer := WebService.GetObject('IISWebServer', '1');
WebRoot := WebServer.GetObject('IISWebVirtualDir', 'Root');
//AList.Add(WebRoot.Name + '=' + WebRoot.Path);
//WebRoot.GetObject('IISWebVirtualDir',Edit1.Text);
// ... TODO
end;
dim websvc, site, root, dir
set websvc = GetObject("IIS://localhost/W3svc"
set site = websvc.GetObject("IIsWebServer", "1"
set root = site.GetObject("IISWebVirtualDir", "Root"
for each dir in root
if dir.class = "IIsWebVirtualDir" then
MsgBox dir.Name + "=" + dir.Path
end if
next
// 以下是Delphi代码,就是VBS的for each部分不知Delphi的如何写?
procedure GetIISWebVirtualDirList(AList: TStrings);
var
WebSite, WebService, WebServer, WebRoot: Variant;
begin
AList.Clear;
WebSite := CreateOleObject('IISNamespace');
WebService := WebSite.GetObject('IISWebService', 'localhost/w3svc');
WebServer := WebService.GetObject('IISWebServer', '1');
WebRoot := WebServer.GetObject('IISWebVirtualDir', 'Root');
//AList.Add(WebRoot.Name + '=' + WebRoot.Path);
//WebRoot.GetObject('IISWebVirtualDir',Edit1.Text);
// ... TODO
end;