Updated: January 2012
Retrieves a cached, read-only instance of a culture by using the specified culture name.
Assembly: mscorlib (in mscorlib.dll)
Public Shared Function GetCultureInfo ( _ name As String _ ) As CultureInfo
public static CultureInfo GetCultureInfo( string name )
public: static CultureInfo^ GetCultureInfo( String^ name )
static member GetCultureInfo : name:string -> CultureInfo
Parameters
- name
- Type: System.String
The name of a culture. name is not case-sensitive.
| Exception | Condition |
|---|---|
| ArgumentNullException |
name is null. |
| CultureNotFoundException |
name specifies a culture that is not supported. |
For a list of predefined culture names, see the National Language Support (NLS) API Reference at the Go Global Developer Center.
The GetCultureInfo method obtains a cached, read-only culture object. It offers better performance than a corresponding call to the CultureInfo.CultureInfo(String) constructor.
If name is the name of the current culture, the returned CultureInfo object does not reflect any user overrides. This makes the method suitable for server applications or tools that do not have a real user account on the system and that need to load multiple cultures efficiently.
If name is String.Empty, the method returns the invariant culture. This is equivalent to retrieving the value of the InvariantCulture property.
Notes to Callers
The .NET Framework version 3.5 and earlier versions throw an ArgumentException if name is not a valid culture name. 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 SP1Windows 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.
Reference
|
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. |