C#| Uri.GetHashCode()方法与示例
Uri.GetHashCode()方法
Uri.GetHashCode()方法是重写方法,它返回一个整数值来表示Uri的哈希码。
语法:
int Uri.GetHashCode();
Parameter(s):
此方法不包含任何参数。
返回值:
此方法的返回类型为int,它返回一个Int32(int)值,其中包含为此URI生成的哈希值。
举例说明方法的例子Uri.GetHashCode()
using System;
class UriExample
{
//程序入口
static public void Main()
{
//创建一个Uri对象
Uri Address;
int hashCode = 0;
Address = new Uri("http://www.nhooo.com");
//获取Uri的哈希码
hashCode = Address.GetHashCode();
Console.WriteLine("Uri Hash Code: {0}",hashCode);
}
}输出结果
Uri Hash Code: 604841720 Press any key to continue . . .
热门推荐
10 年底家庭聚餐简短祝福语
11 岳母八十生日祝福语简短
12 朋友孩子周岁祝福语简短
13 新娘父亲婚礼简短祝福语
14 开工出货大吉祝福语 简短
15 小班春节祝福语大全简短
16 漆沙沙老师祝福语简短
17 领生日祝福语 简短独特
18 18岁生日简短祝福语