This topic has not yet been rated - Rate this topic

CultureInfo.GetCultureInfo Method (Int32)

Updated: January 2012

Retrieves a cached, read-only instance of a culture by using the specified culture identifier.

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)
public static CultureInfo GetCultureInfo(
	int culture
)

Parameters

culture
Type: System.Int32
A locale identifier (LCID).

Return Value

Type: System.Globalization.CultureInfo
A read-only instance of the specified culture.
Exception Condition
ArgumentOutOfRangeException

culture is less than zero.

CultureNotFoundException

culture specifies a culture that is not supported.

We recommend that you use the string overload of this method (GetCultureInfo) to use locale names instead of LCIDs. For custom locales, the locale name is required.

If culture is the locale identifier of the current culture, the returned CultureInfo object does not reflect any user overrides.

Notes to Callers

The .NET Framework version 3.5 and earlier versions throw an ArgumentException if culture is not a valid culture identifier. Starting with the .NET Framework version 4, this method throws a CultureNotFoundException.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Date

History

Reason

January 2012

Revised the Remarks section.

Information enhancement.

August 2010

Expanded the Remarks section.

Customer feedback.

June 2010

Updated exception information.

Content bug fix.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ