次の方法で共有


ServiceDescriptionCollection.IndexOf メソッド

指定した ServiceDescription を検索し、コレクション内でその文字列が最初に見つかった位置の 0 から始まるインデックス番号を返します。

Public Function IndexOf( _
   ByVal serviceDescription As ServiceDescription _) As Integer
[C#]
public int IndexOf(ServiceDescriptionserviceDescription);
[C++]
public: int IndexOf(ServiceDescription* serviceDescription);
[JScript]
public function IndexOf(
   serviceDescription : ServiceDescription) : int;

パラメータ

  • serviceDescription
    コレクション内での検索対象となる ServiceDescription

戻り値

32 ビット符号付き整数。

使用例

 
' Get the index of a ServiceDescription.
Dim myIndex As Integer = myCollection.IndexOf(myServiceDescription2)

' Remove a ServiceDescription from the collection.
myCollection.Remove(myServiceDescription2)
Console.WriteLine("Element at index {0} is removed.", _
   myIndex.ToString())

[C#] 
// Get the index of a ServiceDescription.
int myIndex = myCollection.IndexOf(myServiceDescription2);
 
// Remove a ServiceDescription from the collection.
myCollection.Remove(myServiceDescription2);
Console.WriteLine("Element at index {0} is removed.", myIndex);

[C++] 
// Get the index of 'ServiceDescription' object.
int myIndex = myCollection->IndexOf(myServiceDescription2);
// Remove 'ServiceDescription' object from the collection.
myCollection->Remove(myServiceDescription2);
Console::WriteLine(S"Element at index {0} is removed ",__box( myIndex));

[JScript] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

ServiceDescriptionCollection クラス | ServiceDescriptionCollection メンバ | System.Web.Services.Description 名前空間