The ReadDictionaryFromFile method retrieves data that has been saved in a structured storage file into a specified instance of the Dictionary object.
FileDocument.ReadDictionaryFromFile(FileName, Stream, Dictionary)
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.
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: