日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > C# >内容正文

C#

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

發(fā)布時間:2025/3/11 C# 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c# uri.host_C#| Uri.HostNameType属性与示例 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

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

在上面的程序中,我們創(chuàng)建了一個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属性与示例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。