c# uri.host

Uri.HostNameType属性 (Uri.HostNameType Property)

Uri.HostNameType Property is the instance property of Uri class which used to get the type of hostname specified in the given URI. This property returns a string value. This property may generate System.InvalidOperationException exception.

Uri.HostNameType属性是Uri类的实例属性,用于获取给定URI中指定的主机名类型。 此属性返回一个字符串值。 此属性可能会生成System.InvalidOperationException异常。

Syntax:

句法:

    public UriHostNameType HostNameType { get; }

Return value:

返回值:

The return type of this property is UriHostNameType, it returns a member of the UriHostNameType enumeration.

此属性的返回类型为UriHostNameType ,它返回UriHostNameType枚举的成员。

Example to demonstrate example of Uri.HostNameType Property

演示Uri.HostNameType属性示例的示例

using System;
class UriExample
{//Entry point of Program
static public void Main()
{Uri domainUri;
Uri newUri;
domainUri = new Uri("https://www.includehelp.com:8082");
newUri = new Uri(domainUri, "CPrograms.html?Top=10");
System.Console.WriteLine("HostName Type: " + newUri.HostNameType);
}
}

Output

输出量

HostName Type: Dns

In the above program, we created an object of Uri class initialized with the website name with port number and we got the type of hostname from Uri using HostNameType property.

在上面的程序中,我们创建了一个Uri类的对象,该对象已初始化为带有端口号的网站名称,并使用HostNameType属性从Uri获得了主机名的类型。

Reference: Uri.HostNameType Property

参考: Uri.HostNameType属性

翻译自: https://www.includehelp.com/dot-net/uri-hostnametype-property-with-example.aspx

c# uri.host

c# uri.host_C#| Uri.HostNameType属性与示例相关推荐

  1. c# uri.host_C#| 具有示例的Uri.Host属性

    c# uri.host Uri.Host属性 (Uri.Host Property) Uri.Host Property is the instance property of Uri class w ...

  2. c# uri.host_C#| Uri.CheckHostName()方法与示例

    c# uri.host Uri.CheckHostName()方法 (Uri.CheckHostName() Method) Uri.CheckHostName() method is a stati ...

  3. c# uri.host_C#| 具有示例的Uri.Equality()运算符

    c# uri.host Uri.Equality()运算符 (Uri.Equality() Operator) Uri.Equality() Operator is overloaded which ...

  4. c# uri.host_C#| Uri.GetLeftPart()方法与示例

    c# uri.host Uri.GetLeftPart()方法 (Uri.GetLeftPart() Method) Uri.GetLeftPart() method is an instance m ...

  5. c# uri.host_C#| Uri.IsHexEncoding()方法与示例

    c# uri.host Uri.IsHexEncoding()方法 (Uri.IsHexEncoding() Method) Uri.IsHexEncoding() method is a stati ...

  6. c# uri.host_C#| Uri.FromHex()方法与示例

    c# uri.host Uri.FromHex()方法 (Uri.FromHex() Method) Uri.FromHex() method is a static method that retu ...

  7. c# uri.host_C#| Uri.EscapeUriString()方法与示例

    c# uri.host Uri.EscapeUriString()方法 (Uri.EscapeUriString() Method) Uri.EscapeUriString() method is a ...

  8. java uri getpath_Java URI getPath()用法及代码示例

    getPath()函数是URI类的一部分.函数getPath()返回指定URI的路径名称. 函数签名: public String getPath() 用法: url.getPath() 参数:此功能 ...

  9. Android中的URI 和Uri

    一.URI与Uri 大家可能经常会看到在开发时,怎么有的时候是URI,有的时候是Uri,这是怎么回事? 名称如此相像的两个类是有什么区别和联系? 1.所属的包不同.URI位置在java.net.URI ...

最新文章

  1. img summernote 加类_控制好情绪 的动态 - SegmentFault 思否
  2. 树莓派python实例_使用Python实现树莓派WiFi断线自动重连实例(附代码)
  3. php向数据库添加数据失败,无法从PHP中的表单向数据库添加数据
  4. 处理程序“ExtensionlessUrlHandler-Integrated-4.0”在其模块列表
  5. 反射是最重要的Java API
  6. 在河北大学就读是怎样一种体验?
  7. linux异常级别,linux性能异常定位之进程级别
  8. 一个新的专用浏览器-我的意思是Browzar-不能像宣传的那样工作
  9. Android UI 自定义控件大全
  10. 根据经纬度和日期计算日出日落时间
  11. 计算三维空间中点到三角形平面的最短距离
  12. nodejs操作Excel
  13. css3中自适应边框图片运用
  14. Android项目的targetSDK=23,在低于Android6.0的部分测试机(类似华为)上运行时出现的系统权限问题...
  15. 2019数据安装勾选_如何安装勾选认证平台安全控件,以及如何勾选认证发票
  16. 如何用python搜索要用的素材_一篇文章教会你利用Python网络爬虫获取素材图片
  17. UE4 虚幻引擎,3D数学(二),3D嵌套坐标系。Relative相对位置与World世界位置,Relative相对旋转与World世界坐标旋转。
  18. Python列表,元组,字典,集合 练习
  19. java 声明式编程_声明式编程 - SegmentFault 思否
  20. 2012年下半年软件评测师上午试题

热门文章

  1. Linux基础(iptables与firewalld防火墙)
  2. Python 面向对象 实例方法 属性 (上)
  3. Problem C: 结构体---点坐标结构体
  4. Netweaver里某个software component和C4C的版本
  5. 用vim + xdebug 来追踪thinkphp的执行过程
  6. [译] 想帮助用户做决定?你的APP可以这样设计!
  7. Spring Cloud Zuul网关 Filter、熔断、重试、高可用的使用方式。
  8. 视频通信原理——NAT介绍
  9. Erlang/OTP设计原则(文档翻译)
  10. normalizr API