asp.net.ph

CultureInfo Constructor ( String )

System.Globalization Namespace   CultureInfo Class


Initializes a new instance of the CultureInfo class based on the culture specified by name.

[ VB ]
public Sub New ( _
   ByVal name As String _
) 

[ C# ]
public CultureInfo ( 
   string name
);

[ C++ ]
public: CultureInfo ( 
   String* name
);

[ JScript ]
function CultureInfo ( 
   name : String
);

Parameters

name
A predefined CultureInfo name or the Name of an existing CultureInfo.

Exceptions


Exception Type Condition
ArgumentNullException name is a null reference ( Nothing in Visual Basic ).
ArgumentException name is not a valid culture name.

Remarks

The CultureInfo names follow the RFC 1766 standard in the format "<languagecode2>-<country/regioncode2>", where <languagecode2> is a lowercase two-letter code derived from ISO 639-1 and <country/regioncode2> is an uppercase two-letter code derived from ISO 3166. For example, U.S. English is "en-US". The predefined CultureInfo names are listed in the CultureInfo class topic.

The LCID property of the new CultureInfo is set to the culture identifier associated with the specified name.

The user might choose to override some of the values associated with the current culture of Windows through Regional and Language Options ( or Regional Options or Regional Settings ) in Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. This constructor creates a CultureInfo that uses those overrides and sets the UseUserOverride property to true.

The properties of the DateTimeFormat instance, the NumberFormat instance, and the TextInfo instance are also retrieved from the user settings. If the user settings are incompatible with the culture associated with the CultureInfo ( for example, if the selected calendar is not one of the OptionalCalendars ), the results of the methods and the values of the properties are undefined.

For cultures that use the euro, the .NET Framework and Windows XP set the default currency as euro; however, older versions of Windows do not. Therefore, if the user of an older version of Windows has not changed the currency setting through Regional Options or Regional Settings in Control Panel, the currency might be incorrect. To use the .NET Framework default setting for the currency, use a CultureInfo constructor overload that accepts a useUserOverride parameter and set it to false.

See Also

CultureInfo Members   CultureInfo Constructor Overload List   LCID   UseUserOverride   CreateSpecificCulture Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph