English 中文(简体)
A. 表格中的统计变量?
原标题:Static variables in asp.net?
  • 时间:2011-11-04 04:01:55
  •  标签:
  • asp.net

在网络应用中,我正在使用静态变量,当不止一个用户进入静态变量所宣布的同一页时,它可能是冲突变数? 例如,如果两名雇员在同一页上使用同一页,就会错乱过程?

最佳回答

是的,可能会发生冲突。 你们最后可以采取许多意想不到的行为。 避免这些问题,因为你可能会有一致的问题。

问题回答

冲突很可能发生,变数的状况在整个评估领域都有。

www.un.org/apps/ 这就意味着申请中的所有请求都将如此。 这可能导致冲突。 因此,除非你非常相信行为,而是使用会议,否则就从未使用固定变数。

是的,为什么在你在网上使用静态变量时,你应当小心谨慎。 你们会遇到一些共同的问题,因为为某项请求提供服务可以改变变量的价值。 法定变量范围是应用水平。 如果你在其中储存一些东西,那就错了。 如果一个用户节省了数据,那么Same在另一个用户访问同一页时也将获得同样的数据。 因此试图在会议上储存这些价值观。

虽然这项工作在单一用户环境中进行, 在一个多用户环境中发生的情况,如果2个用户同时从2台电脑中登录,用户1将价值定为200台,那么用户2将价值定为400台。 在该用户之后,1 援引Get Value纽顿。 他认为什么价值?





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签