CompareInfo.GetCompareInfo Method (String, Assembly)
Initializes a new instance of the CompareInfo class that is associated with the culture having the specified name and uses string comparison methods in the specified Assembly.
[Visual Basic] Overloads Public Shared Function GetCompareInfo( _ ByVal name As String, _ ByVal assembly As Assembly _ ) As CompareInfo [C#] public static CompareInfo GetCompareInfo( string name, Assembly assembly ); [C++] public: static CompareInfo* GetCompareInfo( String* name, Assembly* assembly ); [JScript] public static function GetCompareInfo( name : String, assembly : Assembly ) : CompareInfo;
Parameters
- name
- A string representing the culture name.
- 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 culture having the specified name and uses string comparison methods in the specified Assembly.
Exceptions
| Exception Type | Condition |
|---|---|
| ArgumentNullException | name is a null reference (Nothing in Visual Basic).
-or- assembly is a null reference (Nothing). |
| ArgumentException | name is an invalid culture name.
-or- 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