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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HttpListenerPrefixCollection.Contains メソッドの意味・解説 

HttpListenerPrefixCollection.Contains メソッド

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

指定したプレフィックスがコレクションに含まれているかどうかを示す Boolean 値を返します。

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

Public Function Contains ( _
    uriPrefix As String _
) As Boolean
Dim instance As HttpListenerPrefixCollection
Dim uriPrefix As String
Dim returnValue As Boolean

returnValue = instance.Contains(uriPrefix)
public bool Contains (
    string uriPrefix
)
public:
virtual bool Contains (
    String^ uriPrefix
) sealed
public final boolean Contains (
    String uriPrefix
)
public final function Contains (
    uriPrefix : String
) : boolean

パラメータ

uriPrefix

テストする URI プレフィックスを格納している String。

戻り値
このコレクションに uriPrefix で指定したプレフィックスが存在する場合は true。それ以外の場合は false。

例外例外
例外の種類条件

ArgumentNullException

uriPrefix が null 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

HttpListener のプレフィックス コレクションにユーザー指定のプレフィックスが存在するかどうかを確認するコード例を次に示します。

public static bool CheckForPrefix(HttpListener
 listener, string prefix)
{
    // Get the prefixes that the Web server is listening to.
    HttpListenerPrefixCollection prefixes = listener.Prefixes;
    if (prefixes.Count == 0 || prefix == null)
    {
        return false;
    }
    return prefixes.Contains(prefix);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HttpListenerPrefixCollection クラス
HttpListenerPrefixCollection メンバ
System.Net 名前空間
HttpListener クラス



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

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

   

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



HttpListenerPrefixCollection.Contains メソッドのページの著作権

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

©2026 GRAS Group, Inc.RSS