您的位置:首页 > 移动开发

Application、Session、Server 状态管理

2006-10-18 23:32 666 查看
Application 可以存放任何对象,包括数组.
以下是Application 存放数组的例子

前台页面代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Application.aspx.cs" Inherits="ApplicationSessionServer_Application" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
=============================<br />
Application 可以存放任何对象,包括数组.<br />
以下是Application 存放数组的例子<br />
<br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="存储数组" />
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="读取数组" /><br />
<br />
<asp:ListBox ID="ListBox1" runat="server" Height="145px" Width="158px"></asp:ListBox></div>
</form>
</body>
</html>

后台代码CS:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ApplicationSessionServer_Application : System.Web.UI.Page
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: