TextInfo.LCID 属性

定义

获取与当前 TextInfo 对象关联的区域性的区域性标识符。Gets the culture identifier for the culture associated with the current TextInfo object.

public:
 property int LCID { int get(); };
public int LCID { get; }
[System.Runtime.InteropServices.ComVisible(false)]
public int LCID { get; }
member this.LCID : int
[<System.Runtime.InteropServices.ComVisible(false)>]
member this.LCID : int
Public ReadOnly Property LCID As Integer

属性值

Int32

一个数字,标识创建当前 TextInfo 对象所使用的区域性。A number that identifies the culture from which the current TextInfo object was created.

属性

注解

此类和命名空间中的其他类使用一些预定义的区域性名称和标识符 System.GlobalizationCertain predefined culture names and identifiers are used by this and other classes in the System.Globalization namespace. 有关 Windows 系统的详细区域性信息,请参阅 windows 支持的语言/区域名称列表中的 语言标记 列。For detailed culture information for Windows systems, see the Language tag column in the list of language/region names supported by Windows. 列名遵循 BCP 47 定义的标准。Culture names follow the standard defined by BCP 47.

LCID属性始终反映特定区域性标识符,而不是非特定区域性标识符。The LCID property always reflects a specific culture identifier instead of a neutral culture identifier. 如果 CultureInfo.LCID 设置为非特定区域性标识符,则相应的将 LCID 其值指定为使用同一语言的任意特定区域性标识符。If CultureInfo.LCID is set to a neutral culture identifier, the corresponding LCID has as its value an arbitrary specific culture identifier that uses the same language. 例如,属性将 CultureInfo.LCID 返回名为 "en" 的英语非特定区域性的0x0009。For example, the CultureInfo.LCID property returns 0x0009 for the English neutral culture, named "en". 但是,相应的 LCID 属性可能返回名为 en-us 的英语 (美国) 区域性的0x0409。However, the corresponding LCID property might return 0x0409 for the English (United States) culture, named en-US.

同样, LCID 属性始终对应于默认的排序顺序,并且永远不会反映特定的排序顺序。Similarly, the LCID property always corresponds to a default sort order, and never reflects a specific sort order. 例如,西班牙语 (西班牙) 的默认排序顺序是国际排序顺序。For example, the default sort order for Spanish (Spain) is the international sort order. 如果将 CultureInfo.LCID "0x040A" 设置为 "" (西班牙语,并) 传统排序顺序,则对应的 LCID 值为 "0x0C0A" (西班牙语,并) 默认的国际排序顺序。If CultureInfo.LCID is set to "0x040A" (Spanish with the traditional sort order), the corresponding LCID value is "0x0C0A" (Spanish with the default international sort order).

适用于