关于IIS的信息:
IIS ADSI objects 是一些COM对象,包括IIsWebInfo ,IISWebServer,IISWebService,IIsWebVirtualDir等,您可以在命令行,ASP,VB,VC程序中使用这些对象来更改 IIS存储在IIS Metabase中的设置。
每个 IIS ADSI对象对应于 Metabase中的一个节点,如IIsWebVirtualDir 对应于Metabase中IIsWebVirtualDir 节点,您可以如下例利用ADSI的IIsWebVirtualDir对象的来获得并修改虚拟目录的各项属性。
Private Sub Command1_Click()
Set cont1 = GetObject("IIS:// MachineName/W3SVC/1/ROOT/vdirName")
Debug.Print cont1.AnonymousUserName
Debug.Print cont1.Path
Debug.Print cont1.AuthAnonymous
cont1. AnonymousPasswordSync=true
cont1. AnonymousUserName=”UserName”
cont1.AuthAnonymous = True
cont1.SetInfo
End Sub
详细信息请参考:
IIsWebVirtualDir
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/html/psdk/asp/aore8v5e.asp
IIS Admin Objects Overview
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/html/psdk/asp/aogu0t6f.asp
Administrative Tasks Using the IIS Admin Objects
http://msdn.microsoft.com/library/en-us/iisref/html/psdk/asp/aogu7vub.asp
Q240941 An Introduction to the IIS Metabase
http://support.microsoft.com/support/kb/articles/q240/9/41.asp