English 中文(简体)
当时只有一名用户使用蚊帐
原标题:Only one user of asp.net web application at time

我有具体要求,因为网络应用性质,只允许一个用户及时使用作为p.net应用程序。

我试图通过使用某些会议柜台,使用申请国来实施这一规定,而这种柜台正在本届会议上加固......开始并节省会议时间,但问题是,当申请显示标识时(由于形式认证),会议立即开始。

如果第一用户浏览器显示的是日元,则会议在全球开始。 召集轴心和增加1场会议。 议员现在平等。

If another user browser also displays login.aspx, before first user is authenticated, session_start in global.asax is called and sessioncounter is increased for 1. SessionCounter now equals 2.

My idea was to authenticate user only if SessionCounter <= 1. But in upper described case we will have a lock becase sessionCounter is already 2 and if first or second user tries to login, it will not be able to authenticate because sessioncounter is greater then 1.

第二个问题是,在认证时间过前,会议时间过长。 如果第一用户会议时间已经结束,而此时第二用户试图对第二用户进行标识,则会成功提出申请。 但是,如果第一用户因他的了解没有时间而背后,情况会发生。 新的会议将开始,会议将: 启动活动手稿将叫作,会议柜台将增加,但由于用户已经认证,用户仍然被拖到会。

什么是最佳办法? 之所以能够避免申请国,是因为ASP.net 3.5已经知道召集会议的问题——紧接着会议—— 1. 如果会议目标没有使用,开始。

我对使用一些数据库的旗帜进行了思考,但随后我会遇到另一个问题。 如果用户在重新划定这一国旗之前关闭浏览器,情况会发生。 在提高旗帜时,我可以插入一些时间。 然后,我有以下设想:

First user logs in. DB flag is raised and timestamp is inserted. First user forgets to log out and only closes browser.

第二位用户试图登录。 对非行旗进行了检查,因为已经提高了旗号,他无法申请。 如果我设定了另一个条件来检查一下,如果某些时间从最后插入的时间段(例如30分钟)过去了,那么我可以允许第二用户获得申请,而不论非行旗,但这不是一个好的解决办法。

What is the best solution for this problem? Is there any global variable available in .net framework which allows us to check total online user count (I am not using membership provider)?

最佳回答

You should be able to do this through IIS by limiting the number of connections and adding a custom error page to handle 403.9 (Forbidden - Too Many Users) errors.

“entergraph

问题回答

暂无回答




相关问题
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!

热门标签