Code to Generate an Encoded URL String

This example shows how to create an encoded URL string containing custom properties.

  1. Create two SafeArrays to hold the custom property/value pairs.

    Dim savProperties, savValues
    
  2. Populate the SafeArrays.

    savProperties(0) = "SKU"
    savValues(0) = "F13B69881E"
    savProperties(1) = "Quantity"
    savValues(1) = 3
    
  3. Using the AuthManager object, oAuthManager, created and initialized in Code to Create and Initialize AuthManager, create a URL to reference the file Weeklysales.asp. The second parameter indicates that cookies are disabled and causes the AuthManager object to append the user ID from the MCSCAuth ticket to the string. The third parameter indicates the URL is secure.

    Dim sURL
    sURL = oAuthManager.GetURL("Weeklysales.asp", False, True, _
                               savProperties, savValues)
    
  4. The resulting URL string follows.

    ' sURL = https://host_name/virtual_directory/weeklysales.asp?SKU=
    '        F13B69881E&Quantity=3&MSCSAuth=Q0H4SE915ASH2KC000Q79QB1E
    

Copyright © 2005 Microsoft Corporation.
All rights reserved.