GetCompareInfo Method (Int32, Assembly)

CompareInfo.GetCompareInfo Method (Int32, Assembly)

Initializes a new CompareInfo object that is associated with the specified culture and that uses string comparison methods in the specified Assembly.

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

public static CompareInfo GetCompareInfo(
	int culture,
	Assembly assembly
)

Parameters

culture
Type: System.Int32
An integer representing the culture identifier.
assembly
Type: System.Reflection.Assembly
An Assembly that contains the string comparison methods to use.

Return Value

Type: System.Globalization.CompareInfo
A new CompareInfo object associated with the culture with the specified identifier and using string comparison methods in the current Assembly.

ExceptionCondition
ArgumentNullException

assembly is null.

ArgumentException

assembly is of an invalid type.

NoteNote

The behavior of this method is unpredictable. It is recommended for your application to use a version of this method that does not take an assembly input.

The assembly parameter must be of the same type as Module.Assembly.

If a security decision depends on a string comparison or a case change, the application should use the InvariantCulture to ensure that the behavior is consistent regardless of the culture settings of the operating system.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.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.

Community Additions

ADD
Show:
© 2016 Microsoft