English 中文(简体)
ASP.NET 如何在某个特定用户的某个时间只处理1个吉普勒河岸边远地铁道问题?
原标题:ASP.NET How to process only 1 HTTP handler at a time from a specified user?

I have the next problem: I need to process only 1 request at a time from each user. Lets assume that server identifies each user be UserID, sent in query string. How can make the server work the way like FIFO (do not start processing next request until the previous is fully processed)? Should I use the named mutexes inside HTTP handler and assign the name to mutex by UserID?

Thanks in advance, Valentin

最佳回答

在提出第一项请求时,在届会期间树立了旗帜。 只有在处理第一份请求后,才重开这一国旗。

如果用户再次提出要求,而没有完成第一项请求,就只是拒绝这一请求,即在没有执行任何进一步法典的情况下从程序要求中返回。 此外,你还可以以适当的状况回答用户。

EDIT

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.SessionState;

namespace MyHandlers
{
    public class MyHttpHander : IHttpHandler,IRequiresSessionState
    {
        public bool IsReusable
        {
            get { return true; }
        }

        public void ProcessRequest(HttpContext context)
        {
            context.Response.Write("<h1><b>HttpHandler Test</b></h1>");
            context.Session["Test"] = "Invoke a session in HttpHandler.";
            context.Response.Write(context.Session["Test"]+"<br>");
            context.Response.Write("<a href= HttpHandlerCsharp.aspx ><b>return</b></a>");
        }
    }
} 
问题回答

暂无回答




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

热门标签