ObjectListCommandCollection.IndexOf(String) 方法

定義

傳回命令的索引,該命令的名稱為指定的字串。 這個 API 已經過時。 如需如何開發 ASP.NET 行動應用程式的資訊,請參閱 具有 ASP.NET 的Mobile Apps & Sites

public:
 int IndexOf(System::String ^ s);
public int IndexOf (string s);
member this.IndexOf : string -> int
Public Function IndexOf (s As String) As Integer

參數

s
String

要在集合中搜尋的字串。

傳回

命令的索引,該命令的名稱為指定的字串。

備註

傳回命令的索引,其 Name 屬性是 s 參數所指定的字串。 如果在集合中找不到相符的專案,方法 IndexOf 會傳回 -1。

適用於

另請參閱