Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
503 lines (445 sloc) 33.2 KB
<Type Name="SessionStateItemCollection" FullName="System.Web.SessionState.SessionStateItemCollection">
<TypeSignature Language="C#" Value="public sealed class SessionStateItemCollection : System.Collections.Specialized.NameObjectCollectionBase, System.Collections.ICollection, System.Web.SessionState.ISessionStateItemCollection" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed SessionStateItemCollection extends System.Collections.Specialized.NameObjectCollectionBase implements class System.Collections.ICollection, class System.Collections.IEnumerable, class System.Web.SessionState.ISessionStateItemCollection" />
<TypeSignature Language="DocId" Value="T:System.Web.SessionState.SessionStateItemCollection" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class SessionStateItemCollection&#xA;Inherits NameObjectCollectionBase&#xA;Implements ICollection, ISessionStateItemCollection" />
<TypeSignature Language="C++ CLI" Value="public ref class SessionStateItemCollection sealed : System::Collections::Specialized::NameObjectCollectionBase, System::Collections::ICollection, System::Web::SessionState::ISessionStateItemCollection" />
<TypeSignature Language="F#" Value="type SessionStateItemCollection = class&#xA; inherit NameObjectCollectionBase&#xA; interface ISessionStateItemCollection&#xA; interface ICollection&#xA; interface IEnumerable" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Collections.Specialized.NameObjectCollectionBase</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Collections.ICollection</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Collections.IEnumerable</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.SessionState.ISessionStateItemCollection</InterfaceName>
</Interface>
</Interfaces>
<Docs>
<summary>A collection of objects stored in session state. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.SessionState.SessionStateItemCollection> class is used to manage session-state variable values indexed by a variable name or by numerical index. The session-state variables are exposed to ASP.NET application code using the <xref:System.Web.SessionState.HttpSessionState> class, which is accessed using the <xref:System.Web.HttpContext.Session%2A> property of the current <xref:System.Web.HttpContext> or the <xref:System.Web.UI.Page>. The <xref:System.Web.SessionState.HttpSessionState> class calls the <xref:System.Web.SessionState.HttpSessionStateContainer> class, which manages session-state variable values using the <xref:System.Web.SessionState.SessionStateItemCollection>.
## Examples
The following code example creates a new <xref:System.Web.SessionState.SessionStateItemCollection> object and sets and gets values in the collection by name.
[!code-csharp[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/CS/keyscs.aspx#1)]
[!code-vb[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/VB/keysvb.aspx#1)]
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When you create a custom session-state provider based on the <see cref="T:System.Web.SessionState.SessionStateStoreProviderBase" /> class, use the <see cref="T:System.Web.SessionState.SessionStateItemCollection" /> class to manage the items stored in session state. If you need to create a custom object to manage session-state items, implement the <see cref="T:System.Web.SessionState.ISessionStateItemCollection" /> interface.</para>
</block>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SessionStateItemCollection ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.SessionState.SessionStateItemCollection.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; SessionStateItemCollection();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Creates a new, empty <see cref="T:System.Web.SessionState.SessionStateItemCollection" /> object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.SessionState.SessionStateItemCollection> class is used to manage session-state variable values indexed by a variable name or by numerical index. The session-state variables are exposed to ASP.NET application code using the <xref:System.Web.SessionState.HttpSessionState> class, which is accessed using the <xref:System.Web.HttpContext.Session%2A> property of the current <xref:System.Web.HttpContext> or the <xref:System.Web.UI.Page>. The <xref:System.Web.SessionState.HttpSessionState> class calls the <xref:System.Web.SessionState.HttpSessionStateContainer> class, which manages session-state variable values using the <xref:System.Web.SessionState.SessionStateItemCollection> collection.
## Examples
The following code example creates a new <xref:System.Web.SessionState.SessionStateItemCollection> object and sets and gets values in the collection by name.
[!code-csharp[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/CS/keyscs.aspx#1)]
[!code-vb[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/VB/keysvb.aspx#1)]
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<Member MemberName="Clear">
<MemberSignature Language="C#" Value="public void Clear ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Clear() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.SessionState.SessionStateItemCollection.Clear" />
<MemberSignature Language="VB.NET" Value="Public Sub Clear ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Clear();" />
<MemberSignature Language="F#" Value="abstract member Clear : unit -&gt; unit&#xA;override this.Clear : unit -&gt; unit" Usage="sessionStateItemCollection.Clear " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.SessionState.ISessionStateItemCollection.Clear</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Removes all values and keys from the session-state collection.</summary>
<remarks>To be added.</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<Member MemberName="Deserialize">
<MemberSignature Language="C#" Value="public static System.Web.SessionState.SessionStateItemCollection Deserialize (System.IO.BinaryReader reader);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Web.SessionState.SessionStateItemCollection Deserialize(class System.IO.BinaryReader reader) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.SessionState.SessionStateItemCollection.Deserialize(System.IO.BinaryReader)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Deserialize (reader As BinaryReader) As SessionStateItemCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Web::SessionState::SessionStateItemCollection ^ Deserialize(System::IO::BinaryReader ^ reader);" />
<MemberSignature Language="F#" Value="static member Deserialize : System.IO.BinaryReader -&gt; System.Web.SessionState.SessionStateItemCollection" Usage="System.Web.SessionState.SessionStateItemCollection.Deserialize reader" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.SessionState.SessionStateItemCollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="reader" Type="System.IO.BinaryReader" />
</Parameters>
<Docs>
<param name="reader">The <see cref="T:System.IO.BinaryReader" /> used to read the serialized collection from a stream or encoded string.</param>
<summary>Creates a <see cref="T:System.Web.SessionState.SessionStateItemCollection" /> collection from a storage location that is written to using the <see cref="M:System.Web.SessionState.SessionStateItemCollection.Serialize(System.IO.BinaryWriter)" /> method.</summary>
<returns>A <see cref="T:System.Web.SessionState.SessionStateItemCollection" /> collection populated with the contents from a storage location that is written to using the <see cref="M:System.Web.SessionState.SessionStateItemCollection.Serialize(System.IO.BinaryWriter)" /> method.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
[!INCLUDE [untrusted-data-method-note](~/includes/untrusted-data-method-note.md)]
The <xref:System.Web.SessionState.SessionStateItemCollection.Deserialize%2A> method can be used to read the contents of a <xref:System.Web.SessionState.SessionStateItemCollection> collection from the session store.
To write the contents of a <xref:System.Web.SessionState.SessionStateItemCollection> object to the session store, use the <xref:System.Web.SessionState.SessionStateItemCollection.Serialize%2A> method.
## Examples
The following code example creates a <xref:System.Web.SessionState.SessionStateItemCollection> collection from a file that was created using the <xref:System.Web.SessionState.SessionStateItemCollection.Serialize%2A> method.
[!code-csharp[System.Web.SessionState.SessionStateItemCollection#4](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/CS/serializecs.aspx#4)]
[!code-vb[System.Web.SessionState.SessionStateItemCollection#4](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/VB/serializevb.aspx#4)]
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">The session state information is invalid or corrupted</exception>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<Member MemberName="Dirty">
<MemberSignature Language="C#" Value="public bool Dirty { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Dirty" />
<MemberSignature Language="DocId" Value="P:System.Web.SessionState.SessionStateItemCollection.Dirty" />
<MemberSignature Language="VB.NET" Value="Public Property Dirty As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool Dirty { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.Dirty : bool with get, set" Usage="System.Web.SessionState.SessionStateItemCollection.Dirty" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.SessionState.ISessionStateItemCollection.Dirty</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the collection has been marked as changed.</summary>
<value>
<see langword="true" /> if the <see cref="T:System.Web.SessionState.SessionStateItemCollection" /> contents have been changed; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.SessionState.SessionStateItemCollection.Dirty%2A> property is used to indicate whether the contents of the <xref:System.Web.SessionState.SessionStateItemCollection> collection have changed.
The <xref:System.Web.SessionState.SessionStateItemCollection.Dirty%2A> property is set to `true` when an object value is set or added to the collection using the <xref:System.Web.SessionState.SessionStateItemCollection.Item%2A> property and when one or more object values are removed from the collection using the <xref:System.Web.SessionState.SessionStateItemCollection.Remove%2A>, <xref:System.Web.SessionState.SessionStateItemCollection.RemoveAt%2A>, or <xref:System.Web.SessionState.SessionStateItemCollection.Clear%2A> methods.
The <xref:System.Web.SessionState.SessionStateItemCollection.Dirty%2A> property is also set to `true` when a mutable object is retrieved from the collection using the <xref:System.Web.SessionState.SessionStateItemCollection.Item%2A> property.
Calling the <xref:System.Web.SessionState.SessionStateItemCollection.Deserialize%2A> method to populate a <xref:System.Web.SessionState.SessionStateItemCollection> collection results in the <xref:System.Web.SessionState.SessionStateItemCollection.Dirty%2A> property being set to `false`.
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<Member MemberName="GetEnumerator">
<MemberSignature Language="C#" Value="public override System.Collections.IEnumerator GetEnumerator ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Collections.IEnumerator GetEnumerator() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.SessionState.SessionStateItemCollection.GetEnumerator" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetEnumerator () As IEnumerator" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Collections::IEnumerator ^ GetEnumerator();" />
<MemberSignature Language="F#" Value="override this.GetEnumerator : unit -&gt; System.Collections.IEnumerator" Usage="sessionStateItemCollection.GetEnumerator " />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Collections.IEnumerable.GetEnumerator</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.IEnumerator</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns an enumerator that can be used to read all the key names in the collection.</summary>
<returns>An <see cref="T:System.Collections.IEnumerator" /> that can iterate through the variable names in the session-state collection.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example gets the variable names in a <xref:System.Web.SessionState.SessionStateItemCollection> collection using the <xref:System.Web.SessionState.SessionStateItemCollection.GetEnumerator%2A> method.
[!code-csharp[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/CS/keyscs.aspx#1)]
[!code-vb[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/VB/keysvb.aspx#1)]
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<MemberGroup MemberName="Item">
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets or sets a value in the collection.</summary>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</MemberGroup>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public object this[int index] { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object Item(int32)" />
<MemberSignature Language="DocId" Value="P:System.Web.SessionState.SessionStateItemCollection.Item(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Default Public Property Item(index As Integer) As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ default[int] { System::Object ^ get(int index); void set(int index, System::Object ^ value); };" />
<MemberSignature Language="F#" Value="member this.Item(int) : obj with get, set" Usage="System.Web.SessionState.SessionStateItemCollection.Item" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.SessionState.ISessionStateItemCollection.Item(System.Int32)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="index">The numerical index of the value in the collection.</param>
<summary>Gets or sets a value in the collection by numerical index.</summary>
<value>The value in the collection stored at the specified index. If the specified key is not found, attempting to get it returns <see langword="null" />, and attempting to set it creates a new element using the specified key.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
[!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)]
The following code example sets and gets values in a <xref:System.Web.SessionState.SessionStateItemCollection> collection by numerical index.
[!code-csharp[System.Web.SessionState.SessionStateItemCollection#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/CS/keyscs.aspx#2)]
[!code-vb[System.Web.SessionState.SessionStateItemCollection#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/VB/keysvb.aspx#2)]
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public object this[string name] { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance object Item(string)" />
<MemberSignature Language="DocId" Value="P:System.Web.SessionState.SessionStateItemCollection.Item(System.String)" />
<MemberSignature Language="VB.NET" Value="Default Public Property Item(name As String) As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Object ^ default[System::String ^] { System::Object ^ get(System::String ^ name); void set(System::String ^ name, System::Object ^ value); };" />
<MemberSignature Language="F#" Value="member this.Item(string) : obj with get, set" Usage="System.Web.SessionState.SessionStateItemCollection.Item" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.SessionState.ISessionStateItemCollection.Item(System.String)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The key name of the value in the collection.</param>
<summary>Gets or sets a value in the collection by name.</summary>
<value>The value in the collection with the specified name. If the specified key is not found, attempting to get it returns <see langword="null" />, and attempting to set it creates a new element using the specified key.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
[!INCLUDE [untrusted-data-instance-note](~/includes/untrusted-data-instance-note.md)]
The following code example sets and gets values in a <xref:System.Web.SessionState.SessionStateItemCollection> collection by name.
[!code-csharp[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/CS/keyscs.aspx#1)]
[!code-vb[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/VB/keysvb.aspx#1)]
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<Member MemberName="Keys">
<MemberSignature Language="C#" Value="public override System.Collections.Specialized.NameObjectCollectionBase.KeysCollection Keys { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Specialized.NameObjectCollectionBase/KeysCollection Keys" />
<MemberSignature Language="DocId" Value="P:System.Web.SessionState.SessionStateItemCollection.Keys" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property Keys As NameObjectCollectionBase.KeysCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Collections::Specialized::NameObjectCollectionBase::KeysCollection ^ Keys { System::Collections::Specialized::NameObjectCollectionBase::KeysCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Keys : System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" Usage="System.Web.SessionState.SessionStateItemCollection.Keys" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.SessionState.ISessionStateItemCollection.Keys</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Specialized.NameObjectCollectionBase+KeysCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a collection of the variable names for all values stored in the collection.</summary>
<value>The <see cref="T:System.Collections.Specialized.NameObjectCollectionBase.KeysCollection" /> collection that contains all the collection keys.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Each key is a string that represents a variable name for a value stored in the collection.
## Examples
The following code example gets the variable names in a <xref:System.Web.SessionState.SessionStateItemCollection> collection using the variable names returned by the <xref:System.Web.SessionState.SessionStateItemCollection.Keys%2A> property.
[!code-csharp[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/CS/keyscs.aspx#1)]
[!code-vb[System.Web.SessionState.SessionStateItemCollection#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/VB/keysvb.aspx#1)]
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<Member MemberName="Remove">
<MemberSignature Language="C#" Value="public void Remove (string name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Remove(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.SessionState.SessionStateItemCollection.Remove(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub Remove (name As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Remove(System::String ^ name);" />
<MemberSignature Language="F#" Value="abstract member Remove : string -&gt; unit&#xA;override this.Remove : string -&gt; unit" Usage="sessionStateItemCollection.Remove name" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.SessionState.ISessionStateItemCollection.Remove(System.String)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The name of the item to delete from the collection.</param>
<summary>Deletes an item from the collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the <xref:System.Web.SessionState.SessionStateItemCollection> collection does not contain an element with the specified `name`, the collection remains unchanged. No exception is thrown.
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<Member MemberName="RemoveAt">
<MemberSignature Language="C#" Value="public void RemoveAt (int index);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void RemoveAt(int32 index) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.SessionState.SessionStateItemCollection.RemoveAt(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub RemoveAt (index As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void RemoveAt(int index);" />
<MemberSignature Language="F#" Value="abstract member RemoveAt : int -&gt; unit&#xA;override this.RemoveAt : int -&gt; unit" Usage="sessionStateItemCollection.RemoveAt index" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Web.SessionState.ISessionStateItemCollection.RemoveAt(System.Int32)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="index" Type="System.Int32" />
</Parameters>
<Docs>
<param name="index">The index of the item to remove from the collection.</param>
<summary>Deletes an item at a specified index from the collection.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the <xref:System.Web.SessionState.SessionStateItemCollection> collection does not contain an element with the specified `name`, the collection remains unchanged. No exception is thrown.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="index" /> is less than zero.
-or-
<paramref name="index" /> is equal to or greater than <see cref="P:System.Collections.ICollection.Count" />.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
<Member MemberName="Serialize">
<MemberSignature Language="C#" Value="public void Serialize (System.IO.BinaryWriter writer);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void Serialize(class System.IO.BinaryWriter writer) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.SessionState.SessionStateItemCollection.Serialize(System.IO.BinaryWriter)" />
<MemberSignature Language="VB.NET" Value="Public Sub Serialize (writer As BinaryWriter)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void Serialize(System::IO::BinaryWriter ^ writer);" />
<MemberSignature Language="F#" Value="member this.Serialize : System.IO.BinaryWriter -&gt; unit" Usage="sessionStateItemCollection.Serialize writer" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="writer" Type="System.IO.BinaryWriter" />
</Parameters>
<Docs>
<param name="writer">The <see cref="T:System.IO.BinaryWriter" /> used to write the serialized collection to a stream or encoded string.</param>
<summary>Writes the contents of the collection to a <see cref="T:System.IO.BinaryWriter" />.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.SessionState.SessionStateItemCollection.Serialize%2A> method can be used to write the contents of a <xref:System.Web.SessionState.SessionStateItemCollection> collection to the session store.
To retrieve a serialized <xref:System.Web.SessionState.SessionStateItemCollection> object from the session store, use the <xref:System.Web.SessionState.SessionStateItemCollection.Deserialize%2A> method.
## Examples
The following code example creates and populates a <xref:System.Web.SessionState.SessionStateItemCollection> collection and writes the contents to a file using the <xref:System.Web.SessionState.SessionStateItemCollection.Serialize%2A> method.
[!code-csharp[System.Web.SessionState.SessionStateItemCollection#3](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/CS/serializecs.aspx#3)]
[!code-vb[System.Web.SessionState.SessionStateItemCollection#3](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.SessionState.SessionStateItemCollection/VB/serializevb.aspx#3)]
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/6d60d381-6521-4e1d-9089-da6464f2a9bc">ASP.NET Session State Overview</related>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.