发信人: nyxi(南野秀一) 
整理人: winsy(2003-04-22 11:37:59), 站内信件
 | 
 
 
【 在 kn_vb 的大作中提到:】
 :不是在internet信息服务里手工设置,而是用VB编程实现。 
 :
 :我见过有这么一实例的,但源代码怎么写?谢谢指教啊。
 :......
 Private Sub Command1_Click()
 '在Visual Basic中使用ADSI,必须添加对Active DS Type Library(activeds.tlb)的引用。
 Dim WebServer As IADs, WWWService As IADs, WebRoot As IADs, vDir As IADs
 Set WWWService = GetObject("IIS://localhost/W3SVC")
 Set WebServer = GetObject("IIS://localhost/W3SVC/" & "1")
 Set WebRoot = WebServer.GetObject("IIsWebVirtualDir", "Root")
 Set vDir = WebRoot.Create("IIsWebVirtualDir", "VariantTest")'创建一个名为"VariantTest"的虚拟目录
 vDir.Path = "D:\Tools"'目录指向"D:\Tools"
 vDir.AccessRead = True
 vDir.SetInfo
 Set vDir = Nothing
 Set WebRoot = Nothing
 Set WebServer = Nothing
 Set WWWService = Nothing
 End Sub
 
 
  ---- 
 I hope that in time you will find
 What you long for love 
 That's written in the stars
 When you finally leave
 I think you will see it
 Somewhere in my broken heart     | 
 
 
 |