HttpApplicationState.RemoveAt メソッド
アセンブリ: System.Web (system.web.dll 内)


2 つのアプリケーション変数をコレクションに挿入し、RemoveAt メソッドを使用してカスタム HttpApplicationState オブジェクトの最初の変数を削除する方法のコード例を次に示します。
<%@ Page language="VB" AutoEventWireup="true" %> <HTML> <HEAD> <title>HttpApplicationState - RemoveAt - VB.NET Example</title> <script runat="server"> Sub Page_Load(sender As Object, e As EventArgs) ' Add two new application state variables. Application.Add("City", "Redmond") Application.Add("State", "WA") ' Show the contents of both application state variables. Label1.Text = "Application.Keys(0) contains: " & Application.Keys(0).ToString() Label1.Text += "<BR>Application.Keys(1) contains: " & Application.Keys(1).ToString() ' Remove the City application state variable, which is at ' the first index location. Application.RemoveAt(0) Label2.Text = "<BR>Call: Application.RemoveAt(0)" ' Show the contents of the application state variable, ' in the first index location, which is now the State variable. Label3.Text = "<BR>Application.Keys(0) contains: " & Application.Keys(0).ToString() End Sub </script> </HEAD> <body> <form id="Form1" method="post" runat="server"> <h3>HttpApplicationState - RemoveAt - VB.NET Example</h3> <asp:Label id="Label1" runat="server" /><br> <asp:Label id="Label2" runat="server" /><br> <asp:Label id="Label3" runat="server" /> </form> </body> </HTML>
<%@ Page language="c#" AutoEventWireup="true" %> <HTML> <HEAD> <title>HttpApplicationState - RemoveAt - C# Example</title> <script runat="server"> void Page_Load(Object sender, EventArgs e) { // Add two new application state variables. Application.Add("City", "Redmond"); Application.Add("State", "WA"); // Show the contents of both application state variables. Label1.Text = "Application.Keys[0] contains: " + Application.Keys[0].ToString(); Label1.Text += "<BR>Application.Keys[1] contains: " + Application.Keys[1].ToString(); // Remove the City application state variable, which is at // the first index location. Application.RemoveAt(0); Label2.Text = "<BR>Call: Application.RemoveAt(0)"; // Show the contents of the application state variable, // in the first index location, which is now the State variable. Label3.Text = "<BR>Application.Keys[0] contains: " + Application.Keys[0].ToString(); } </script> </HEAD> <body> <form id="Form1" method="post" runat="server"> <h3>HttpApplicationState - RemoveAt - C# Example</h3> <asp:Label id="Label1" runat="server" /><br> <asp:Label id="Label2" runat="server" /><br> <asp:Label id="Label3" runat="server" /> </form> </body> </HTML>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHttpApplicationState.RemoveAt メソッドを検索する場合は、下記のリンクをクリックしてください。

- HttpApplicationState.RemoveAt メソッドのページへのリンク