當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


C# Uri.GetType()用法及代碼示例

Uri.GetType() 方法

Uri.GetType() 方法是一個覆蓋方法,用於返回當前對象的類型。

用法:

    Type Uri.GetType();

參數:

  • 它不接受任何參數。

返回值:

這個方法的返回類型是Type,它返回當前對象的類型。

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

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.GetType());
    }
}

輸出

System.Uri
Press any key to continue . . .


相關用法


注:本文由純淨天空篩選整理自 C# | Uri.GetType() Method with Example。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。