Uri.GetHashCode Method

July 28, 2014

Gets the hash code for the URI.

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

public override int GetHashCode()

Return Value

Type: System.Int32
An Int32 containing the hash value generated for this URI.

The following example creates a Uri instance and writes the hash code to the console.


// Create Uri
Uri uriAddress1 = new Uri("http://www.contoso.com/index.htm#search");
outputBlock.Text += uriAddress1.Fragment;
outputBlock.Text += "\n";

outputBlock.Text += "Hash code: ";
outputBlock.Text += uriAddress1.GetHashCode();
outputBlock.Text += "\n";


Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft