c# uri.host_C#| Uri.IsBaseOf()方法与示例
c# uri.host
Uri.IsBaseOf()方法 (Uri.IsBaseOf() Method)
Uri.IsBaseOf() method is an instance method, which is used to check an object of Uri is the base of another object of Uri class. This method returns a boolean value, if the current object is base on a specified object then it returns true otherwise it returns false.
Uri.IsBaseOf()方法是一个实例方法,用于检查Uri的对象是否是Uri类的另一个对象的基础。 此方法返回一个布尔值,如果当前对象基于指定的对象,则返回true,否则返回false 。
Syntax:
句法:
bool Uri.IsBaseOf(Uri uri);
Parameter(s):
参数:
- Uri uri – represents the object that may be base of current object.
- Uri uri –表示可能是当前对象基础的对象。
Return value:
返回值:
The return type of this method is boolean, if current object is base of specified object then it returns true otherwise it returns false.
此方法的返回类型为boolean ,如果当前对象是指定对象的基础,则返回true,否则返回false 。
Example to demonstrate example of Uri.IsBaseOf() method
演示Uri.IsBaseOf()方法示例的示例
using System;
class UriExample
{
//Entry point of Program
static public void Main()
{
// Create some Uri objects
Uri uri1 = new Uri("https://www.includehelp.com/");
Uri uri2 = new Uri("https://www.duggu.com/");
// Create a new Uri to check above uri are base of this uri or not.
Uri newUri = new Uri("https://www.includehelp.com/C#_Article.aspx");
//here we will check given uri is base of another Uri.
if (uri1.IsBaseOf(newUri))
Console.WriteLine("uri1 is baseof newUri");
else
Console.WriteLine("uri1 is not baseof newUri");
if (uri2.IsBaseOf(newUri))
Console.WriteLine("uri2 is baseof newUri");
else
Console.WriteLine("uri2 is not baseof newUri");
}
}
Output
输出量
uri1 is baseof newUri
uri2 is not baseof newUri
翻译自: https://www.includehelp.com/dot-net/uri-isbaseof-method-with-example.aspx
c# uri.host
上一篇: plt多个图片显示在一个大的图片中
下一篇: URI类分析
推荐阅读
-
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中的内容的解决方法