Επεξεργασία

Κοινή χρήση μέσω


NameValueCollection.Get Method

Definition

Gets the values of a specified entry in the NameValueCollection combined into one comma-separated list.

Overloads

Get(Int32)

Gets the values at the specified index of the NameValueCollection combined into one comma-separated list.

Get(String)

Gets the values associated with the specified key from the NameValueCollection combined into one comma-separated list.

Get(Int32)

Source:
NameValueCollection.cs
Source:
NameValueCollection.cs
Source:
NameValueCollection.cs

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);
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

Parameters

index
Int32

The zero-based index of the entry that contains the values to get from the collection.

Returns

A String that contains a comma-separated list of the values at the specified index of the NameValueCollection, if found; otherwise, null.

Exceptions

index is outside the valid range of indexes for the collection.

Remarks

This method is an O(n) operation, where n is the number of values at the specified index.

See also

Applies to

Get(String)

Source:
NameValueCollection.cs
Source:
NameValueCollection.cs
Source:
NameValueCollection.cs

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);
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

Parameters

name
String

The String key of the entry that contains the values to get. The key can be null.

Returns

A String that contains a comma-separated list of the values associated with the specified key from the NameValueCollection, if found; otherwise, null.

Remarks

Caution

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.

This method is an O(n) operation, where n is the number of values associated with the specified key.

See also

Applies to