UnicodeEncoding.GetHashCode Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Returns the hash code for the current instance.
Assembly: mscorlib (in mscorlib.dll)
The following code example demonstrates how to use the GetHashCode method to return a hash code for a UnicodeEncoding object. Regardless of how the UnicodeEncoding object is created, all objects return the same hash code.
using System; using System.Text; class Example { public static void Demo(System.Windows.Controls.TextBlock outputBlock) { UnicodeEncoding unicode1 = new UnicodeEncoding(); Encoding unicode2 = Encoding.Unicode; outputBlock.Text += unicode1.GetHashCode() + "\n"; outputBlock.Text += unicode2.GetHashCode() + "\n"; } }
Show: