Uri.ToString メソッドとは? わかりやすく解説

Uri.ToString メソッド

指定した Uri インスタンス正規文字列形式返します

名前空間: System
アセンブリ: System (system.dll 内)
構文構文

解説解説
使用例使用例

文字列から新しUri インスタンス作成する例を次に示します。この例では、コンストラクタ渡した文字列返す OriginalString の戻り値と、正規形式の文字列返す ToString呼び出し戻り値相違示します

    ' Create a new Uri from a string address.
    Dim uriAddress As New
 Uri("HTTP://www.Contoso.com:80//thick%20and%20thin.htm")
    
    ' Write the new Uri to the console and note the difference in the
 two values.
    ' ToString() gives the canonical version.  OriginalString gives
 the orginal 
    ' string that was passed to the constructor.
    ' The following outputs "http://www.contoso.com/thick and thin.htm".
    Console.WriteLine(uriAddress.ToString())
    
    ' The following outputs "HTTP://www.Contoso.com:80//thick%20and%20thin.htm".
    Console.WriteLine(uriAddress.OriginalString)

End Sub 'SampleToString
// Create a new Uri from a string address.
Uri uriAddress = new Uri("HTTP://www.Contoso.com:80//thick%20and%20thin.htm");

// Write the new Uri to the console and note the difference in the two
 values.
// ToString() gives the canonical version.  OriginalString gives the
 orginal 
// string that was passed to the constructor.

// The following outputs "http://www.contoso.com/thick and thin.htm".
Console.WriteLine(uriAddress.ToString()); 

// The following outputs "HTTP://www.Contoso.com:80//thick%20and%20thin.htm".
Console.WriteLine(uriAddress.OriginalString);
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からUri.ToString メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からUri.ToString メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からUri.ToString メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Uri.ToString メソッド」の関連用語

Uri.ToString メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Uri.ToString メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS