NameValueCollection.GetValues Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the values of a specified entry in the NameValueCollection.
Overloads
GetValues(Int32) |
Gets the values at the specified index of the NameValueCollection. |
GetValues(String) |
Gets the values associated with the specified key from the NameValueCollection. |
GetValues(Int32)
- Source:
- NameValueCollection.cs
- Source:
- NameValueCollection.cs
- Source:
- NameValueCollection.cs
Gets the values at the specified index of the NameValueCollection.
public:
virtual cli::array <System::String ^> ^ GetValues(int index);
public virtual string[] GetValues (int index);
public virtual string[]? GetValues (int index);
abstract member GetValues : int -> string[]
override this.GetValues : int -> string[]
Public Overridable Function GetValues (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 array that contains 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
GetValues(String)
- Source:
- NameValueCollection.cs
- Source:
- NameValueCollection.cs
- Source:
- NameValueCollection.cs
Gets the values associated with the specified key from the NameValueCollection.
public:
virtual cli::array <System::String ^> ^ GetValues(System::String ^ name);
public virtual string[] GetValues (string name);
public virtual string[]? GetValues (string? name);
abstract member GetValues : string -> string[]
override this.GetValues : string -> string[]
Public Overridable Function GetValues (name As String) As String()
Parameters
Returns
A String array that contains 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.