c# uri.host

Uri.CheckHostName()方法 (Uri.CheckHostName() Method)

Uri.CheckHostName() method is a static method that returns the object of UriHostNameType enum than we need to compare returned enum object with UriHostNameType.Dns. If both are equal then the condition will be true otherwise it will be false.

Uri.CheckHostName()方法是一个静态方法,该方法返回UriHostNameType枚举的对象, 不是我们需要将返回的枚举对象与UriHostNameType.Dns进行比较。 如果两者相等,则条件为true,否则为false

Syntax:

句法:

    UriHostNameType Uri.CheckHostName(string Hostname);

Parameter(s):

参数:

  • string Hostname – represents the hostname to be checked, whether it is valid or not.

    字符串Hostname –表示要检查的主机名,无论它是否有效。

Return value:

返回值:

The return type of this method is UriHostNameType, it returns an object of UriHostNameType enum, that is compared with UriHostNameType.Dns to check DNS is valid or not.

此方法的返回类型为UriHostNameType ,它返回UriHostNameType枚举的对象,该对象与UriHostNameType.Dns进行比较以检查DNS是否有效。

Example to demonstrate example of Uri.CheckHostName() method

演示Uri.CheckHostName()方法示例的示例

using System;
class UriExample
{//Entry point of Program
static public void Main()
{UriHostNameType hostNameType;
hostNameType =Uri.CheckHostName("www.includehelp.com");
if (hostNameType == UriHostNameType.Dns)
{Console.WriteLine("It is valid DNS");
}
else
{Console.WriteLine("It is not valid DNS");
}
hostNameType = Uri.CheckHostName("www.includehelp!com");
if (hostNameType == UriHostNameType.Dns)
{Console.WriteLine("It is valid DNS");
}
else
{Console.WriteLine("It is not valid DNS");
}
}
}

Output

输出量

It is valid DNS
It is not valid DNS

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

c# uri.host

c# uri.host_C#| Uri.CheckHostName()方法与示例相关推荐

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

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

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

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

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

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

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

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

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

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

  6. 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 ...

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

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

  8. android 缩略图uri_课题_android系统通过图片绝对路径获取URI的三种方法

    最近做项目要通过图片的绝对路径找到图片的 URI ,然后删除图片,小小总结一下获取 URI 的方法,亲自试 验在 android 4.1.3 的系统上都是可用的. 1. 将所有的图片路径取出,遍历比较 ...

  9. css不支持data image,CSS_CSS中使用image data URI来处理图片的方法,即将图片资源转换为 base64 字 - phpStudy...

    CSS中使用image data URI来处理图片的方法 即将图片资源转换为 base64 字符串格式嵌到页面或样式中.这样连图片的请求链接都省了. 如: 使用方式 CSS Code复制内容到剪贴板 ...

最新文章

  1. 创业公司反内卷行为大赏
  2. Interview:算法岗位面试—11.15下午上海某航天***公司(国企)技术面之工业机器视觉认知、计算机视觉算法的理解、目标检测相关项目案例
  3. 【codevs1306】广播操的游戏
  4. matlab kfda,SVD与KFDA相结合人脸识别-matlab-毕业论文
  5. @bean注解和@component注解的区别_通过源码查看 @Component,@Service 等注解是如何被解析的...
  6. bat批处理执行python_.bat批处理添加Python任务
  7. HBase数据模型深入剖析-OLAP商业环境实战
  8. Bootstrap 排版列表
  9. 面向对象基本原则-转载
  10. sqlserver 缩小表空间
  11. win10 office 家庭和学生版 excel个人工作簿 PERSONAL.XLSB 的保存位置
  12. SQL 存儲過程加密
  13. serverTimezone
  14. linux认证ppt的图片,linux用户、组和身份认证-课件(PPT-精).ppt
  15. 热重启golang服务器(graceful restart golang http server)
  16. 席慕容《写给幸福》读记
  17. 高德地图API总结--Marker多点聚合
  18. 基于STM32的贪吃蛇小游戏
  19. 谷歌联盟无法收到pin码的解决方案
  20. 【html画板】网页画板绘画效果

热门文章

  1. c++ socket线程池_java 网络编程,Socket编程
  2. C++ static关键字
  3. [分布式训练] 单机多卡的正确打开方式:PyTorch
  4. mysql 副本 同步_副本机制与副本同步
  5. JxBrowser概述与简单应用
  6. 蓝桥杯 出现次数最多的整数
  7. 10.8-全栈Java笔记:序列化/反序列化的步骤和实例
  8. LightGBM中GBDT的实现
  9. JAVA反射系列之Field,java.lang.reflect.Field使用获取方法。
  10. 新一代数据中心不可忽视DAC高速铜缆直连线应用