LoadFromFile Method

The Enterprise Edition of CountryHawk keeps a running total of all statistics in memory. This means that once the application or web services that use CountryHawk are restarted, the statistics will be zeroed.

The CountryStats object provides the PeristToFile and LoadFromFile methods that are used to persist all collected statistics to a file on your server and later reload these statistics back into memory so that additional lookups performed by CountryHawk will be added to the existing results.

Syntax:

 chStatsObj.PersistToFile [pathAndFileName]

pathAndFileName: Optional. If specified, the statistics are read from the path and file name specified by this parameter. If omitted (default), the statistics are read from the path and file name specified by the country.stats.file property listed in the countries.properties file.

Returns:

This method does not return any result. Upon successful execution, all statistics written by a previous call to the PerisistToFile method are loaded into memory. Statistics gathered by additional CountryHawk lookups then are added to these totals. If an error occurs during its operation it raises a run-time error with a description of the problem.

Example:

<% set chStatsObj = Server.CreateObject("cyScape.CountryStats ")

chStatsObj.LoadFromFile %>

Note: This method requires the Enterprise Edition of CountryHawk.

See Also:

PersistToFile Method

CountryHawk Object Properties and Methods

RegionStats Object Properties and Methods