应用程序和会话状态之间的区别 [英] Difference between Application and Session State.

查看:92
本文介绍了应用程序和会话状态之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是umesh。我想知道asp.net中应用程序和会话状态之间的实际区别是什么。

请给我一些演示。

I m umesh.I want to know that what is actual diff between application and session state in asp.net.
pls give me some demo.

推荐答案

你不需要演示,你需要做研究...... MSDN [ ^ ]
You don't need a demo, you need to do research... MSDN[^]


设置时应用程序的所有用户都可以使用应用程序状态

基本上用户A将应用程序变量AppID设置为myApp

用户B检索应用程序变量AppID并读取myApp







会话状态仅为可供ASP.net应用程序的特定用户使用



用户A将会话变量UserID设置为2

用户B加载会话变量UserID并收到null

用户A加载会话变量UserID并且收到2
Application state will be available to all users of the application when set
Basically user A sets application variable "AppID" to "myApp"
User B retrieves application variable "AppID" and reads "myApp"



Session state will only be available to a specific user of the ASP.net application

User A sets session variable "UserID" to "2"
User B loads the session variable "UserID" and receives null
User A loads the session variable "UserID" and receives "2"


主要区别在于应用程序对于整个应用程序是通用的,并且会话对于不同的用户是不同的,否则两者都是相同的



The main difference is that application is common for the whole application and session is different for different user,other wise both are same

Application["samp"] = "something";
Session["samp"] = "something";


这篇关于应用程序和会话状态之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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