CompilerInfo::GetHashCode Method ()

 

Returns the hash code for the current instance.

Namespace:   System.CodeDom.Compiler
Assembly:  System (in System.dll)

public:
virtual int GetHashCode() override

Return Value

Type: System::Int32

A 32-bit signed integer hash code for the current CompilerInfo instance, suitable for use in hashing algorithms and data structures such as a hash table.

This method overrides the Object::GetHashCode method.

This method generates the same hash code for two objects that are equal according to the Equals method.

The following code example creates an instance of the Microsoft.VisualBasic::VBCodeProvider class. The example displays the provider name, hash code, and default file name extension for the new provider instance. This code example is part of a larger example provided for the CompilerInfo class.

         // Get the provider for Microsoft.VisualBasic
//         CodeDomProvider^ provider = CodeDomProvider.CreateProvider("VisualBasic");
         CodeDomProvider^ provider = CodeDomProvider::CreateProvider("VisualBasic");
         if ( provider ) // Display the Visual Basic language provider information.
         {
            Console::WriteLine( "Visual Basic provider is {0}", provider->ToString() );
            Console::WriteLine( "  Provider hash code:     {0}", provider->GetHashCode().ToString() );
            Console::WriteLine( "  Default file extension: {0}", provider->FileExtension );
         }

SecurityPermission

for calling members of CompilerInfo. Demand value: LinkDemand; Associated PermissionState enumeration value: Unrestricted; NIB: Named Permission Sets: FullTrust.

.NET Framework
Available since 2.0
Return to top
Show: