Share via


Code to Retrieve Web Site Properties

The following example enumerates all the Web sites on a server, then for each Web site, it obtains the site properties and displays the VrPath property. Create the example using the following Visual Basic code.

  1. Create the required objects.

    Dim oWebServer, WebSites, oDict
    Set oWebServer = CreateObject("Commerce.AdminWebServer")
    
  2. Call the GetWebSites method of the AdminWebServer object instance. The method returns an array of integers representing all server instances.

    WebSites = oWebServer.GetWebSites
    
  3. Return the WebInstance properties in a dictionary, then display the dictionary values.

    For WebInstance = (LBound(WebSites, 1) + 1) To (UBound(WebSites, 1) + 1)
        Set oDict = oWebServer.GetWebSiteProperties(WebInstance)
        Dim ArrStr(100), i
        i = 1
        For Each property In oDict
        ArrStr(i) = property & " = " & oDict.Value(property)
            str1 = str1 & ArrStr(i) & vbCrLf
            i = i + 1
        Next
        MsgBox str1
        str1 = ""
    Next
    


All rights reserved.