Go homepage(回首页) Upload pictures (上传图片) Write articles (发文字帖)
The author:(作者)delvpublished in(发表于) 2014/1/6 9:04:19 ASP.NET改善application对象加快存储速度_[Asp.Net教程]
public class Global : System.Web.HttpApplication { public static string sGreeting = "China is great!"; …… }
在WebForm1中增加一个label,名称为label1. 在page_load()中为label1的text属性赋值。
private void Page_Load(object sender, System.EventArgs e) { Label1.Text = WebApplication1.Global.sGreeting; }
运行程序后将会看到China is great!
赞