AppConfig Class (PIA)
Use this object to retrieve site configuration settings from the site configuration store. Also, use this object to retrieve names, country/region codes, and state/province codes from the site configuration store.
Methods
Method | Description |
---|---|
DecodeStatusCode | Decodes the specified status code. |
GetCountryCodeFromCountryName | Returns the country/region code for the specified country/region name. |
GetCountryNameFromCountryCode | Returns the country/region name for the specified country/region code. |
GetCountryNamesList | Returns an alphabetical list of country/region names. |
GetOptionsDictionary | Returns a Dictionary object that maps site configuration keys to site configuration values. |
GetRegionCodeFromCountryCodeAndRegionName | Returns the state/province code for the specified country/region code and state/province name. |
GetRegionNameFromCountryCodeAndRegionCode | Returns the state/province name for the specified country/region code and state/province code. |
GetRegionNamesListFromCountryCode | Returns an alphabetical list of state/province names for the specified country/region code. |
Initialize | Initializes the AppConfig object. |
RefreshCache | Refreshes the AppConfig object cache. |
Remarks
[Visual Basic .NET]
This object is usually created once and initialized in the Global.asax**file, for performance reasons. An instance of it is stored in the Application object and used on ASP pages as necessary.
The following example illustrates these steps:
Dim oAppConfig As AppConfig
oAppConfig = New AppConfig()
Application("MSCSAppCfg") = oAppConfig
Country/region codes may or may not be the same as International Organization for Standardization (ISO) country/region codes, depending on what values have been added in Commerce Server Business Desk.
[C#]
This object is usually created once and initialized in the Global.asax file, for performance reasons. An instance of it is stored in the Application object and used on ASP pages as necessary.
The following example illustrates these steps:
<%@ Import Namespace="Microsoft.CommerceServer.Interop.Configuration" %>
<script language="C#">
AppConfig MyConfig = new AppConfig();
MyConfig.Initialize("MySite");
Application("AppConfig") = MyConfig;
</script>
Country/Region codes may or may not be the same as ISO country/region codes, depending on what values have been added in Business Desk.
For more information on ISO country/region codes, see Table of Country/Region Names and Codes and Table of Language Culture Names, Codes, and ISO Values.
Requirements
Namespace: Microsoft.CommerceServer.Interop.Configuration
Platforms: Windows 2000, Windows Server 2003
Assembly: apphelperlib (in apphelperlib.dll)
See Also
Table of Country/Region Names and Codes
Copyright © 2005 Microsoft Corporation.
All rights reserved.