Uri.OriginalString プロパティ
アセンブリ: System (system.dll 内)



コンストラクタに指定した 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);

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- Uri.OriginalString プロパティのページへのリンク