CompareInfo.Version 属性


获取用于比较和排序字符串的 Unicode 版本的相关信息。Gets information about the version of Unicode used for comparing and sorting strings.

 property System::Globalization::SortVersion ^ Version { System::Globalization::SortVersion ^ get(); };
public System.Globalization.SortVersion Version { get; }
member this.Version : System.Globalization.SortVersion
Public ReadOnly Property Version As SortVersion


包含用于比较和排序字符串的 Unicode 版本的相关信息的对象。An object that contains information about the Unicode version used for comparing and sorting strings.


各个字符的权重,因此,比较或排序特定字符串的方式取决于特定版本的 .NET Framework 所实现的 Unicode 规范的版本。The weight of individual characters, and therefore the way in which particular strings are compared or ordered, depends on the version of the Unicode specification that a particular version of the .NET Framework implements. .NET Framework 4.5.NET Framework 4.5 中,这也取决于主机操作系统,如下表所示。In the .NET Framework 4.5.NET Framework 4.5, this also depends on the host operating system, as the following table shows. 请注意,受支持的 Unicode 版本的列表仅适用于字符比较和排序;不适用于 Unicode 字符串按类别分类。Note that this list of supported Unicode versions applies to character comparison and sorting only; it does not apply to classification of Unicode characters by category.

.NET Framework 版本.NET Framework version 操作系统Operating system Unicode 版本Unicode version
.NET Framework 4.NET Framework 4 所有操作系统All operating systems Unicode 5.0Unicode 5.0
.NET Framework 4.5.NET Framework 4.5 及更高版本and later versions Windows 7Windows 7 Unicode 5.0Unicode 5.0
.NET Framework 4.5.NET Framework 4.5 及更高版本and later versions Windows 8Windows 8 和更高版本的 Windows 操作系统版本and later Windows operating system versions Unicode 6。3Unicode 6.3

SortVersion 属性返回的 Version 对象不标识用于比较字符串的准确 Unicode 版本。The SortVersion object returned by the Version property doesn't identify the precise Unicode version used to compare strings. 仅在比较两个 SortVersion 对象来确定它们是否使用相同版本的 Unicode 版本和区域性来比较字符串时很有用。It is useful only when comparing two SortVersion objects to determine whether they use the same Unicode version and culture to compare strings. 有关详细信息和示例,请参见 SortVersion 引用页。For more information and an example, see the SortVersion reference page.