[VB6 - IIS7] - Uitlezen metabase

Pagina: 1
Acties:

Acties:
  • 0 Henk 'm!

  • Nutcaze
  • Registratie: Oktober 1999
  • Laatst online: 16-08 06:35
Ik heb het volgende stukje code wat werkt:

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Dim Output As String

Dim oService As WbemScripting.SWbemServicesEx
Dim oSites As WbemScripting.SWbemObjectSet
Dim oSite As WbemScripting.SWbemObjectEx
     
Set oService = GetObject("winmgmts:root\WebAdministration")
    
Set oSites = oService.InstancesOf("Site")
For Each oSite In oSites
        Output = Output & oSite.Name & " (" & oSite.Id & ")"
Next
Set oSite = Nothing
Set oSites = Nothing
Set oService = Nothing
    
MsgBox Output
    
End


Het enige wat ik wil weten is het fysieke pad op disk waar de virtual directory "/" in staat.

oftewel ik heb domein "domeinnaam.nl" en de root daarvan draait in bijv. D:\Websites\domeinnaam.nl\

Dat laatste deel dus "D:\Websites\domeinnaam.nl\" wil ik opvragen ik heb alleen geen idee hoe. Het lijkt er niet op dat het object SWbemObjectEx zo'n property heeft.

Iemand enig idee hoe ik die er uit haal?

Not all chemicals are bad. Without hydrogen or oxygen, for example, there would be no way to make water, a vital ingredient in beer.


Acties:
  • 0 Henk 'm!

  • Azzmodan
  • Registratie: Juni 2000
  • Laatst online: 02-04 14:57
De virtual directory heeft de physical path. Je heb de sitename al, dus daarmee pak je de virtualdirectory en die heeft een PhysicalPath:

code:
1
2
3
4
5
6
For Each oSite In oSites
    Output = Output & oSite.Name & " (" & oSite.Id & ")"  

    Set oVD = oService.Get("VirtualDirectory.SiteName='" & oSite.Name & "',ApplicationPath='/',Path='/'")
    Output = Output & "Path: " &  oVD.PhysicalPath & vbCrLf
Next

Acties:
  • 0 Henk 'm!

  • Nutcaze
  • Registratie: Oktober 1999
  • Laatst online: 16-08 06:35
Geweldig. Het werkt. Bedankt!

Not all chemicals are bad. Without hydrogen or oxygen, for example, there would be no way to make water, a vital ingredient in beer.