Uri.IsBaseOf メソッドとは?

辞典・百科事典の検索サービス - Weblio辞書

初めての方へ

参加元一覧


用語解説|全文検索

.NET Framework クラス ライブラリ リファレンス

日本マイクロソフト株式会社日本マイクロソフト株式会社

Uri.IsBaseOf メソッド

メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。

現在の Uri インスタンスが、指定した Uriベースかどうか判断します。

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

Public Function IsBaseOf ( _
    uri As Uri _
) As Boolean
Dim instance As Uri
Dim uri As Uri
Dim returnValue As Boolean

returnValue = instance.IsBaseOf(uri)
public bool IsBaseOf (
    Uri uri
)
public:
bool IsBaseOf (
    Uri^ uri
)
public boolean IsBaseOf (
    Uri uri
)

パラメータ

uri

テスト対象指定する Uri

戻り値
現在の Uri インスタンスuriベースである場合true。それ以外の場合false

解説解説

IsBaseOf使用して、指定した Uri と現在の Uri インスタンス比較し、この URI が、指定した Uriベースであるかどうか判断します。2 つの Uri オブジェクト比較して、ベース関係を判断する場合ユーザー情報 (UserInfo) は評価されません。2 つの URI (uri1 と uri2) の比較で、最後スラッシュ後ろをすべて無視した場合にこれら 2 つの URI が同じであるときは、uri1 は uri2 のベースです。次の表では、http://host/path/path/file?queryベース URI として使用し、この URI が他の URIベースであるかどうか示します。

URI

http://host/path/path/file?query次の URIベースかどうか

http://host/path/path/file/

http://host/path/path/#fragment

http://host/path/path/MoreDir/"

http://host/path/path/OtherFile?Query

http://host/path/path/

http://host/path/path/file

http://host/path/path

×

http://host/path/path?query

×

http://host/path/path#Fragment

×

http://host/path/path2/

×

http://host/path/path2/MoreDir

×

http://host/path/File

×

使用例使用

この例では、ベース Uri インスタンスを表す Uri インスタンス作成します。また、文字列から 2 つ目の Uri インスタンス作成します。さらに、IsBaseOf呼び出して、ベース インスタンスが 2 つ目のインスタンスベースであるかどうか判断します。結果コンソール出力されます。

' Create a base Uri.
Dim baseUri As New Uri("http://www.contoso.com/")

' Create a new Uri from a string.
Dim uriAddress As New Uri("http://www.contoso.com/index.htm?date=today")

' Determine whether BaseUri is a base of UriAddress.  
If baseUri.IsBaseOf(uriAddress) Then
    Console.WriteLine("{0} is the base of {1}", baseUri,
 uriAddress)
End If
// Create a base Uri.
Uri baseUri = new Uri("http://www.contoso.com/");

// Create a new Uri from a string.
Uri uriAddress = new Uri("http://www.contoso.com/index.htm?date=today");
 

// Determine whether BaseUri is a base of UriAddress.  
if (baseUri.IsBaseOf(uriAddress))
    Console.WriteLine("{0} is the base of {1}", baseUri,
 uriAddress);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照





Uri.IsBaseOf メソッドのページへのリンク
Uri.IsBaseOf メソッドのお隣キーワード
モバイル
モバイル版のWeblioは、下記のURLからアクセスしてください。
http://m.weblio.jp/
_ _   


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

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

©2012 Weblio RSS