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.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2015 Microsoft