CompareInfo::GetCompareInfo Method (String, Assembly)
Initializes a new CompareInfo object that is associated with the specified culture and that uses string comparison methods in the specified Assembly.
Assembly: mscorlib (in mscorlib.dll)
Parameters
- name
- Type: System::String
A string representing the culture name.
- assembly
- Type: System.Reflection::Assembly
An Assembly that contains the string comparison methods to use.
Return Value
Type: System.Globalization::CompareInfoA new CompareInfo object associated with the culture with the specified identifier and using string comparison methods in the current Assembly.
| Exception | Condition |
|---|---|
| ArgumentNullException | name is nullptr. -or- assembly is nullptr. |
| ArgumentException | name is an invalid culture name. -or- assembly is of an invalid type. |
Note |
|---|
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 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.
Note