这是我的源代码,我遇到困难,如果多个用户同时尝试访问文件,它阻止其他用户的请求直到完成第一个请求,我怎么能在这里编写并发代码,以便它允许所有用户同时访问文件。
void IHttpModule.Init(HttpApplication httpApp)
{
this.HttpApplication = httpApp;
httpApp.AuthenticateRequest += new EventHandler(context_AuthenticateRequest);
httpApp.EndRequest += new EventHandler(context_EndRequest);
httpApp.BeginRequest += new EventHandler(context_BeginRequest);
}
void context_BeginRequest(object sender, EventArgs e)
{
HttpApplication _httpApp = (HttpApplication)sender;
this.IsWebDAVRequest = false;
this.RequestHttpMethod = _httpApp.Context.Request.HttpMethod;
foreach (string _enumName in Enum.GetNames(typeof(DavOptionsBase.HttpMethods)))
{
if (this.RequestHttpMethod.Equals(_enumName, StringComparison.InvariantCultureIgnoreCase))
{
this.IsWebDAVRequest = true;
break;
}
}
}
#endregion
请建议我