NameValueCollection.Get NameValueCollection.Get NameValueCollection.Get NameValueCollection.Get Method

定義

取得組合成一個逗號分隔清單的 NameValueCollection 中的指定項目的值。Gets the values of a specified entry in the NameValueCollection combined into one comma-separated list.

多載

Get(Int32) Get(Int32) Get(Int32) Get(Int32)

取得組合成一個逗號分隔清單的 NameValueCollection 的指定索引值。Gets the values at the specified index of the NameValueCollection combined into one comma-separated list.

Get(String) Get(String) Get(String) Get(String)

由組合成一個逗號分隔清單的 NameValueCollection 取得與指定索引鍵相關的值。Gets the values associated with the specified key from the NameValueCollection combined into one comma-separated list.

Get(Int32) Get(Int32) Get(Int32) Get(Int32)

取得組合成一個逗號分隔清單的 NameValueCollection 的指定索引值。Gets the values at the specified index of the NameValueCollection combined into one comma-separated list.

public:
 virtual System::String ^ Get(int index);
public virtual string Get (int index);
abstract member Get : int -> string
override this.Get : int -> string
Public Overridable Function Get (index As Integer) As String

參數

index
Int32 Int32 Int32 Int32

以零起始的項目索引,包含從集合取得的值。The zero-based index of the entry that contains the values to get from the collection.

傳回

String,包含 NameValueCollection 的指定索引值的逗號分隔清單 (如果找到的話),否則為 nullA String that contains a comma-separated list of the values at the specified index of the NameValueCollection, if found; otherwise, null.

例外狀況

index 超出集合索引的有效範圍。index is outside the valid range of indexes for the collection.

備註

這個方法是 O (n) 運算, 其中n是指定索引處的值數目。This method is an O(n) operation, where n is the number of values at the specified index.

另請參閱

Get(String) Get(String) Get(String) Get(String)

由組合成一個逗號分隔清單的 NameValueCollection 取得與指定索引鍵相關的值。Gets the values associated with the specified key from the NameValueCollection combined into one comma-separated list.

public:
 virtual System::String ^ Get(System::String ^ name);
public virtual string Get (string name);
abstract member Get : string -> string
override this.Get : string -> string
Public Overridable Function Get (name As String) As String

參數

name
String String String String

項目的 String 索引鍵,包含要取得的值。The String key of the entry that contains the values to get. 這個索引鍵可以是 nullThe key can be null.

傳回

String,包含與 NameValueCollection 的指定索引鍵關聯的值的逗號分隔清單 (如果找到的話),否則為 nullA String that contains a comma-separated list of the values associated with the specified key from the NameValueCollection, if found; otherwise, null.

備註

警告

null在下列情況中, 這個方法會傳回:1) 如果找不到指定的索引鍵, 則為,如果找到指定的索引鍵, 且其相關聯的值為null, 則為 2)。This method returns null in the following cases: 1) if the specified key is not found; and 2) if the specified key is found and its associated value is null. 這個方法不會區分這兩種情況。This method does not distinguish between the two cases.

這個方法是 O (n) 運算, 其中n是與指定索引鍵相關聯的值數目。This method is an O(n) operation, where n is the number of values associated with the specified key.

另請參閱

適用於