SessionStateItemCollection.GetEnumerator 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.
Returns an enumerator that can be used to read all the key names in the collection.
public:
override System::Collections::IEnumerator ^ GetEnumerator();
public override System.Collections.IEnumerator GetEnumerator ();
override this.GetEnumerator : unit -> System.Collections.IEnumerator
Public Overrides Function GetEnumerator () As IEnumerator
Returns
An IEnumerator that can iterate through the variable names in the session-state collection.
Implements
Examples
The following code example gets the variable names in a SessionStateItemCollection collection using the GetEnumerator method.
SessionStateItemCollection items = new SessionStateItemCollection();
items["LastName"] = "Wilson";
items["FirstName"] = "Dan";
foreach (string s in items.Keys)
Response.Write("items[\"" + s + "\"] = " + items[s].ToString() + "<br />");
Dim items As SessionStateItemCollection = New SessionStateItemCollection()
items("LastName") = "Wilson"
items("FirstName") = "Dan"
For Each s As String In items.Keys
Response.Write("items(""" & s & """) = " & items(s).ToString() & "<br />")
Next
Applies to
See also
Samarbeid med oss på GitHub
Du finner kilden for dette innholdet på GitHub. Der du også kan opprette og se gjennom problemer og pull-forespørsler. Hvis du vil ha mer informasjon, kan du se vår bidragsyterveiledning.