共用方式為


OperationCollection.IndexOf(Operation) 方法

定義

搜尋指定的 Operation,並傳回集合中第一個符合項目之以零起始的索引。

public:
 int IndexOf(System::Web::Services::Description::Operation ^ operation);
public int IndexOf (System.Web.Services.Description.Operation operation);
member this.IndexOf : System.Web.Services.Description.Operation -> int
Public Function IndexOf (operation As Operation) As Integer

參數

operation
Operation

Operation,要在集合中搜尋它。

傳回

Int32

32 位元帶正負號的整數。

範例

下列範例示範 IndexOf 方法的用法。

if ( myOperationCollection->Contains( myOperation ) == true )
{
   Console::WriteLine( "The index of the added 'myOperation' operation is : {0}", myOperationCollection->IndexOf( myOperation ) );
}
if(myOperationCollection.Contains(myOperation) == true)
{
   Console.WriteLine("The index of the added 'myOperation' " +
                     "operation is : " +
                     myOperationCollection.IndexOf(myOperation));
}
If myOperationCollection.Contains(myOperation) = True Then
   Console.WriteLine("The index of the added 'myOperation' " + _
            "operation is : " + _
            myOperationCollection.IndexOf(myOperation).ToString)
End If

適用於