Previous in Contents Next in Contents

FileDocument.ReadDictionaryFromFile Method

The ReadDictionaryFromFile method retrieves data that has been saved in a structured storage file into a specified instance of the Dictionary object.

Syntax

FileDocument.ReadDictionaryFromFile(FileName, Stream, Dictionary)

Parameters

FileName
A string containing the name of the structured storage file to read.
Stream
A string containing the name of the stream to read within the file. Thirty-one characters maximum.
Dictionary
A pointer to a Dictionary object into which to copy the stream data.

Remarks

The ReadDictionaryFromFile method requires that the destination Dictionary object already be created. Using ReadDictionaryFromFile in this way enables you to save the site dictionary in the Application object.

The ReadDictionaryFromFile method adds values from the file to the Dictionary object; it does not clear the object first.

The specified stream must be in the root storage of the structured storage file.

Example

The following sample is from the Clocktower's Global.asa file, which initializes the Commerce Server site application:

REM -- Create Store Dictionary
   Set MSCSSite = Server.CreateObject("Commerce.Dictionary")

   REM -- Read Store Dictionary
   Set FD = Server.CreateObject("Commerce.FileDocument")
   Call FD.ReadDictionaryFromFile( Request("APPL_PHYSICAL_PATH") + "/config/site.csc",
       "IISProperties", MSCSSite)

To retrieve the Commerce Server site information, the sample first creates a FileDocument object ("FD") to enable use of the ReadDictionaryFromFile method. The call to ReadDictionaryFromFile takes three arguments:

Related Topics


© 1997-2000 Microsoft Corporation. All rights reserved.