All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
在系统中生成Excel流并传给用户_[Asp.Net教程]
ASP.NET(C#)生成静态html页面_[Asp.Net教程]
ASP.NET2.0中配置文件的加密与解密_[Asp.Net教程]
用FSO操作xml_[XML教程]
PHP中session详解_[PHP教程]
net在cs程序中加入JS(背景不会变白)_[Asp.Net教程]
SQL大全[2]_mssql学习_编程技术
用,PHPRPC,实现,Ajax,级联下拉菜单_php资料_编程技术
PHP5 OOP编程之代理与定制异常_[PHP教程]
ajax+php无刷新二级联动下拉菜单(省市联动)源码_[PHP教程]
Reading number is top 10 pictures
Summer is most suitable for young people to travel in China5
The dog buy the ham oneself
Cesarean section, bloody, silently into it!1
girl of HuNan name is LiXiang(湖南辣姐李湘的写真)
Lewd,it is too lewd.
The real super beauty12
Sora aoi mirror memorial classics2
The service WaLiangGe Chinese aircraft carrier1
Men's and women's orgasms
各种囧况!玩游戏最不喜欢出现的十件事
Download software ranking
Boxer vs Yellow1
JSP+Ajax Web development typical examples
Tram sex maniac 2 (H) rar bag5
变速齿轮3.26
Sora aoi, the maid, students' uniforms
Desire a peach blossom
Unix video tutorial17
Tram sex maniac 2 (H) rar bag13
Tram sex maniac 2 (H) rar bag12
金山office2007
delv published in(发表于) 2014/1/6 9:04:19 Edit(编辑)
ASP.NET改善application对象加快存储速度_[Asp.Net教程]

ASP.NET改善application对象加快存储速度_[Asp.Net教程]

ASP.NET改善application对象加快存储速度_[Asp.Net教程]

在传统的ASP中,我们要用application对象去存储应用于整个application的变量。这当然会带来内存消耗的代价。在.net中,我们可以用static变量来改善它,采用static 变量在大多数时候存储的速度会比application对象快。
 
做法:

创建一个webApplication,假设名称为webApplication1,在Global.aspx中的Global类中增加一个静态的成员sGreeting.

 
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!


来源:网页教学网





添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.