Uri.Fragment プロパティ
アセンブリ: System (system.dll 内)
Fragment プロパティは、URI 内のフラグメント マーカ (#) とその後に続くテキストを取得します。http://www.contoso.com/index.htm#main という URI を指定すると、このフラグメント プロパティにより #main が取得されます。
Uri インスタンスを作成し、フラグメント情報をコンソールに出力する例を次に示します。
' Create Uri Dim uriAddress As New Uri("http://www.contoso.com/index.htm#search") Console.WriteLine(uriAddress.Fragment) Console.WriteLine("Uri {0} the default port ", IIf(uriAddress.IsDefaultPort, "uses", "does not use")) 'TODO: For performance reasons this should be changed to nested IF statements Console.WriteLine("The path of this Uri is {0}", uriAddress.GetLeftPart(UriPartial.Path)) Console.WriteLine("Hash code {0}", uriAddress.GetHashCode())
// Create Uri Uri uriAddress = new Uri("http://www.contoso.com/index.htm#search"); Console.WriteLine(uriAddress.Fragment); Console.WriteLine("Uri {0} the default port ", uriAddress.IsDefaultPort ? "uses" : "does not use"); Console.WriteLine("The path of this Uri is {0}", uriAddress.GetLeftPart(UriPartial.Path)); Console.WriteLine("Hash code {0}", uriAddress.GetHashCode());
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.Fragment プロパティのページへのリンク