IHTTP模块首次停止

时间:2016-11-28 06:01:27

标签: c# delay ihttpmodule

我面临着不同的问题,我的代码如下:

private void context_AuthRequest(object sender, EventArgs e)
{            
    MyPrincipal principal = null;
    MyClient getClient = new MyClientService().GetByClientID(Instance.ClientID.Value);            
    Guid? userAuthTicketID = GetUserAuthenticationTicketID();

    if (userAuthTicketID.HasValue)
    {
        principal = GetPrincipal(userAuthTicketID.Value);
    }
    if (principal != null)
    {
        //delay for first time approximately to 8 sec
        HttpContext.Current.User = principal;
        System.Threading.Thread.CurrentPrincipal = principal; 
    }
    else
    {
        //delay for first time approximately to 8 sec
    }

}

你能帮我解释为什么会有延迟

0 个答案:

没有答案