c# uri.host
Uri.CheckSchemeName()方法 (Uri.CheckSchemeName() Method)
Uri.CheckSchemeName() method is a static method that returns a boolean value, if the specified scheme is valid then it returns true otherwise it returns false.
Uri.CheckSchemeName()方法是一个返回布尔值的静态方法,如果指定的方案有效,则返回true,否则返回false 。
Syntax:
句法:
bool Uri.CheckSchemeName(string SchemeName);
Parameter(s):
参数:
string SchemeName – represents the specified SchemeName to be checked, it is valid or not.
字符串SchemeName –表示要检查的指定SchemeName,它是否有效。
Return value:
返回值:
The return type of this method is Boolean, it returns a boolean value, if the specified scheme is valid then it returns true otherwise it returns false.
此方法的返回类型为Boolean ,它返回一个布尔值,如果指定的方案有效,则返回true,否则返回false 。
Example to demonstrate example of Uri.CheckSchemeName() method
演示Uri.CheckSchemeName()方法示例的示例
using System;
class UriExample
{
//Entry point of Program
static public void Main()
{
bool isValid = false;
Uri domainUri1;
domainUri1 = new Uri("https://www.includehelp.com/index.html");
isValid=Uri.CheckSchemeName(domainUri1.Scheme);
if (isValid == true)
Console.WriteLine("Valid Scheme");
else
Console.WriteLine("Invalid Scheme");
}
}
Output
输出量
Valid Scheme
翻译自: https://www.includehelp.com/dot-net/uri-checkschemename-method-with-example.aspx
c# uri.host