c# uri.host

Uri.Host属性 (Uri.Host Property)

Uri.Host Property is the instance property of Uri class which used to get host components from URI. This property returns a string value. This property may generate System.InvalidOperationException exception.

Uri.Host属性Uri类的实例属性,用于从URI获取主机组件。 此属性返回一个字符串值。 此属性可能会生成System.InvalidOperationException异常。

Syntax:

句法:

    public string Host { get; }

Return value:

返回值:

The return type of this property is string, it returns a string that contains the host name. This is usually the DNS host name or IP address of the server.

该属性的返回类型为string ,它返回一个包含主机名的字符串。 通常是服务器的DNS主机名或IP地址。

Example to demonstrate example of Uri.Host Property

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

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("Host Component: " + newUri.Host);
}
}

Output

输出量

Host Component: www.includehelp.com

In the above program, we created an object of Uri class initialized with the website name with port number and we got host component from Uri.

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

Reference: Uri.Host Property

参考: Uri.Host属性

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

c# uri.host

c# uri.host_C#| 具有示例的Uri.Host属性相关推荐

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

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

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

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

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

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

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

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

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

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

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

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

  7. c# uri.host_C#| Uri.HostNameType属性与示例

    c# uri.host Uri.HostNameType属性 (Uri.HostNameType Property) Uri.HostNameType Property is the instance ...

  8. java uri_Android中的Uri与Java中的URI类

    首先,先来说一下什么是URI,URI是英文Uniform Resource Identifier即统一资源识别符,简单的说它的作用就是用来识别或者标识资源名称用的一串字符串. 我们先来看一个字符串: ...

  9. c# uri 取文件名_C# System.Uri类_获取Url的各种属性_文件名_参数_域名_端口等等

    System.Uri类用于处理Uri地址信息,常用到它的地方有,相对Uri地址转绝对Uri地址,获取Uri的某部分信息等等,可以说是一个非常有用的类. 一.属性 AbsolutePath 获取 URI ...

最新文章

  1. [翻译] DSL和模型驱动开发的最佳实践(3/4)
  2. linux下把进程绑定到特定cpu核上运行
  3. Python中如何拷贝一个对象?(赋值、深拷贝、浅拷贝的区别)
  4. union 中的注意事项
  5. 实体嵌入Entity Embedding及代码实现
  6. 偷懒的inline-block解决方法
  7. [云炬创业基础]创业过程
  8. IDEA 运行键是灰色
  9. spark java8 scala_在 Ubuntu16.04 中搭建 Spark 单机开发环境 (JDK + Scala + Spark)
  10. 制造业物料清单BOM、智能文档阅读、科学文献影响因子、Celebrated Italian mathematician ZepartzatT Gozinto 与 高津托图...
  11. keytool条目_java keytool 常用命令
  12. Hadoop 生态系列之 1.0 和 2.0 架构
  13. 在linux下安装Avria(小红伞)
  14. CentOS5.6系统中安装并使用USB无线网卡(配置成功) 转
  15. 微信中直接打开手机系统浏览器的实现
  16. 解决MyEclipse中导入项目的javascript文件中文乱码
  17. 有了雀巢智能咖啡机,单身狗离“秀恩爱”还会远吗?
  18. 黑马程序员—[Android就业薪资] Android31期,毕业18个工作日,就业率71.95%,薪资9946元
  19. Element table 导出Excel重复数据
  20. 【面试宝典】软件测试工程师2021烫手精华版(第一章测试理论篇)

热门文章

  1. c++ map初始化_Go学习每日一问(18)-map元素查找
  2. Linux打包软件版本带时间,带你写一个 linux 下的打包软件 tar
  3. mysql 5.5.18下载_MySQL5.7.18下载和安装过程图文详解
  4. mysql 101_MySQL 调优/优化的 101 个建议!
  5. MySQL 数据库误删除后的数据恢复操作说明
  6. 搭建基于C#和 Appium 的 Android自动测试环境
  7. js 判断日期时间差
  8. jquery中阻止事件冒泡的方法
  9. 使用PHP建立SVN的远程钩子,使用exec命令自动更新SVN的代码
  10. squid代理服务器(捎带的SNAT)