This documentation is archived and is not being maintained.

CompareInfo.GetCompareInfo Method (Int32, Assembly)

.NET Framework 1.1

Initializes a new instance of the CompareInfo class that is associated with the culture having the specified identifier and uses string comparison methods in the specified Assembly.

[Visual Basic]
Overloads Public Shared Function GetCompareInfo( _
   ByVal culture As Integer, _
   ByVal assembly As Assembly _
) As CompareInfo
[C#]
public static CompareInfo GetCompareInfo(
 int culture,
 Assembly assembly
);
[C++]
public: static CompareInfo* GetCompareInfo(
 int culture,
 Assembly* assembly
);
[JScript]
public static function GetCompareInfo(
   culture : int,
 assembly : Assembly
) : CompareInfo;

Parameters

culture
An integer representing the culture identifier.
assembly
An Assembly that contains the string comparison methods to use.

Return Value

A new instance of the CompareInfo class that is associated with the specified culture and uses string comparison methods in the specified Assembly.

Exceptions

Exception Type Condition
ArgumentNullException assembly is a null reference (Nothing in Visual Basic).
ArgumentException assembly is of an invalid type.

Remarks

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 operation, use the InvariantCulture to ensure that the behavior will be consistent regardless of the culture settings of the system.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

CompareInfo Class | CompareInfo Members | System.Globalization Namespace | CompareInfo.GetCompareInfo Overload List | Module.Assembly

Show: