c# uri.host_C#| Uri.IsWellFormedOriginalString()方法与示例

c# uri.host

Uri.IsWellFormedOriginalString()方法 (Uri.IsWellFormedOriginalString() Method)

Uri.IsWellFormedOriginalString() method is used to check whether given Uri is well-formed or not, if Uri is well-formed, the method returns true otherwise it returns false.

Uri.IsWellFormedOriginalString()方法用于检查给定的Uri是否格式正确,如果Uri格式正确 ,则该方法返回true,否则返回false

Syntax:

句法:

    bool Uri.IsWellFormedOriginalString();

Parameter(s):

参数:

  • It does not accept any parameter.

    它不接受任何参数。

Return value:

返回值:

The return type of this method is boolean, it returns true if specified uri is well-formed, otherwise it returns false.

此方法的返回类型为boolean ,如果指定的uri格式正确 ,则返回true ,否则返回false

Exception:

例外:

    System.InvalidOperationException;

Example to demonstrate example of Uri.IsWellFormedOriginalString() method

演示Uri.IsWellFormedOriginalString()方法示例的示例

using System;

class UriExample
{
    //Entry point of Program
    static public void Main()
    {
        // Create some Uri objects
        Uri uri = new Uri("https://www.includehelp.com/");
        
        if (uri.IsWellFormedOriginalString())
            Console.WriteLine("uri is well-formed.");
        else
            Console.WriteLine("uri is not well-formed.");
    }
}

Output

输出量

uri is well-formed.


翻译自: https://www.includehelp.com/dot-net/uri-iswellformedoriginalstring-method-with-example.aspx

c# uri.host

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值