ASP.Net中的应用程序对象 [英] Application Object in ASP.Net

查看:80
本文介绍了ASP.Net中的应用程序对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

在哪种情况下,我们在RealTime Projects中使用Application对象?
请澄清一下.

Hi All,

In which scenario we use Application object in RealTime Projects?
Please clarify me.

推荐答案

应用程序对象对所有会话均通用.对于应用程序是唯一的.这意味着一个应用程序对象对于所有用户都是相同的.为了修改应用程序对象的值,需要在修改之前锁定应用程序对象".

可以在要向所有用户提供公共信息的地方使用该应用程序对象.如:

1)请求计数器.
2)全局变量等.
Application object is common to all the sessions & unique to application. That means an application object will be same for all the users. For modifying the application object value one need to take Lock on App Object before modifying.

The application object can be used where you want to provide a common information to all the users. Such as :

1) Request Counter.
2) Global Variables etc.


这篇关于ASP.Net中的应用程序对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆