c# uri.host_C#| Uri.GetLeftPart()方法与示例
c# uri.host
Uri.GetLeftPart()方法 (Uri.GetLeftPart() Method)
Uri.GetLeftPart() method is an instance method that is used to get a specified part from the given URI based on passed UriPartial enum.
Uri.GetLeftPart()方法是一個實例方法,用于基于傳遞的UriPartial枚舉從給定URI中獲取指定部分。
Syntax:
句法:
string Uri.GetLeftPart (UriPartial Part);Parameter(s):
參數(shù):
Part – represents UriPartial to get specified part from Uri.
零件 –表示從Uri獲取指定零件的UriPartial。
Return value:
返回值:
The return type of this method is string, it returns string value to represent specified part of Uri.
該方法的返回類型為string ,它返回表示Uri指定部分的字符串值。
Exception:
例外:
System.ArgumentException;System.InvalidOperationException;Example to demonstrate example of Uri.GetLeftPart() method
演示Uri.GetLeftPart()方法示例的示例
using System;class UriExample {//Entry point of Programstatic public void Main(){// Create an object of UriUri Address;Address = new Uri("https://www.includehelp.com/index.html#search");Console.WriteLine(Address.GetLeftPart(UriPartial.Authority));Console.WriteLine(Address.GetLeftPart(UriPartial.Path));Console.WriteLine(Address.GetLeftPart(UriPartial.Query));Console.WriteLine(Address.GetLeftPart(UriPartial.Scheme));} }Output
輸出量
https://www.includehelp.com https://www.includehelp.com/index.html https://www.includehelp.com/index.html https://翻譯自: https://www.includehelp.com/dot-net/uri-getleftpart-method-with-example.aspx
c# uri.host
總結(jié)
以上是生活随笔為你收集整理的c# uri.host_C#| Uri.GetLeftPart()方法与示例的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 索尼4K HDR电视画面的呈现效果怎样?
- 下一篇: c# uri.host_C#| 具有示例