Uri.OriginalString プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Uri.OriginalString プロパティの意味・解説 

Uri.OriginalString プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

Uri コンストラクタ渡された元の URI 文字列取得します

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

Dim instance As Uri
Dim value As String

value = instance.OriginalString
public string OriginalString { get;
 }
public:
property String^ OriginalString {
    String^ get ();
}
/** @property */
public String get_OriginalString ()
public function get OriginalString
 () : String

プロパティ
このインスタンス作成時に指定した URI 自体を含む Stringそれ以外場合Empty

例外例外
例外種類条件

InvalidOperationException

このインスタンス相対 URI表します。このプロパティは、絶対 URI でのみ有効です。

解説解説

コンストラクタ指定した URI先行または後続空白文字含まれる場合、これらの空白文字保持されます。

このプロパティからの戻り値は、ToString および AbsoluteUri とは異なりますToString からは、エスケープ解除され正規形式の URI返されます。AbsoluteUri からは、エスケープされた正規形式の URI返されます。

使用例使用例

文字列から新し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 'SampleOriginalString
// 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);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

Uri.OriginalString プロパティのお隣キーワード
検索ランキング

   

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



Uri.OriginalString プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS