diff --git a/Common/Config.cs b/Common/Config.cs index 0f1e0cd..e7afc60 100644 --- a/Common/Config.cs +++ b/Common/Config.cs @@ -8,7 +8,10 @@ namespace FLocal.Common { public class Config : FLocal.Core.Config { + public readonly string InitTime; + protected Config(NameValueCollection data) : base(data) { + this.InitTime = DateTime.Now.ToLongTimeString(); } public static void Init(NameValueCollection data) { diff --git a/Core/Config.cs b/Core/Config.cs index 4d624af..4a51ea2 100644 --- a/Core/Config.cs +++ b/Core/Config.cs @@ -43,5 +43,11 @@ namespace FLocal.Core { } } + public static bool isInitialized { + get { + return _instance != null; + } + } + } } diff --git a/IISMainHandler/MainHandler.cs b/IISMainHandler/MainHandler.cs index f00bc48..1e6139d 100644 --- a/IISMainHandler/MainHandler.cs +++ b/IISMainHandler/MainHandler.cs @@ -13,7 +13,7 @@ namespace FLocal.IISHandler { } public void ProcessRequest(HttpContext httpcontext) { - FLocal.Common.Config.ReInit(ConfigurationManager.AppSettings); + if(!FLocal.Common.Config.isInitialized) FLocal.Common.Config.Init(ConfigurationManager.AppSettings); WebContext context = new WebContext(httpcontext); ISpecificHandler handler = HandlersFactory.getHandler(context); diff --git a/IISMainHandler/handlers/DebugHandler.cs b/IISMainHandler/handlers/DebugHandler.cs index 6576dc3..52449ff 100644 --- a/IISMainHandler/handlers/DebugHandler.cs +++ b/IISMainHandler/handlers/DebugHandler.cs @@ -19,6 +19,7 @@ namespace FLocal.IISHandler.handlers { context.httpresponse.WriteLine("Path: " + context.httprequest.Path); context.httpresponse.WriteLine("PathInfo: " + context.httprequest.PathInfo); context.httpresponse.WriteLine("AppInfo: " + context.config.AppInfo); + context.httpresponse.WriteLine("InitTime: " + context.config.InitTime); } }