c# uri.host_C#| Uri.GetLeftPart()方法与示例
程序员文章站
2024-02-13 20:50:58
...
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):
参数:
- 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 Program
static public void Main()
{
// Create an object of Uri
Uri 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
上一篇: TCP/IP协议
推荐阅读
-
c# uri.host_C#| Uri.HexEscape()方法与示例
-
c# uri.host_C#| Uri.IsBaseOf()方法与示例
-
Android Studio导入Eclipse项目的两种方法
-
c# uri.host_C#| Uri.GetLeftPart()方法与示例
-
struts2中action实现ModelDriven后无法返回json的解决方法
-
java poi导出图片到excel示例代码
-
c# uri.host_C#| 具有示例的Uri.TryCreate()方法
-
处理jsp显示文字过长问题的解决方法
-
asp.net通过配置文件连接Access的方法
-
jsp无法提交nicEdit中的内容的解决方法