An alternative to UBB.threads
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
FLocal/IISMainHandler/MainHandler.cs

36 lines
935 B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Configuration;
namespace FLocal.IISHandler {
public class MainHandler : IHttpHandler {
public bool IsReusable {
get { return true; }
}
public void ProcessRequest(HttpContext httpcontext) {
Uri referer = httpcontext.Request.UrlReferrer;
if(referer != null && referer.PathAndQuery.StartsWith("/static")) {
throw new HttpException(403, "You have come from the static page");
}
if(!FLocal.Common.Config.isInitialized) {
lock(typeof(FLocal.Common.Config)) {
if(!FLocal.Common.Config.isInitialized) {
FLocal.Common.Config.Init(ConfigurationManager.AppSettings);
}
}
}
WebContext context = new WebContext(httpcontext);
ISpecificHandler handler = HandlersFactory.getHandler(context);
handler.Handle(context);
}
}
}