示例#1
0
 public static void Init(AspApplicationHost host, AspRequestBroker reqBroker)
 {
     AppHost   = host;
     ReqBroker = reqBroker;
     string[] fileSystemEntries = Directory.GetFileSystemEntries(AppHost.Path, "?efault.aspx");
     if ((fileSystemEntries == null) || (fileSystemEntries.Length < 1))
     {
         fileSystemEntries = Directory.GetFileSystemEntries(AppHost.Path, "?ndex.aspx");
     }
     if ((fileSystemEntries == null) || (fileSystemEntries.Length < 1))
     {
         fileSystemEntries = Directory.GetFileSystemEntries(AppHost.Path, "?efault.cshtml");
     }
     if ((fileSystemEntries == null) || (fileSystemEntries.Length < 1))
     {
         fileSystemEntries = Directory.GetFileSystemEntries(AppHost.Path, "?ndex.cshtml");
     }
     if ((fileSystemEntries == null) || (fileSystemEntries.Length < 1))
     {
         fileSystemEntries = Directory.GetFileSystemEntries(AppHost.Path, "?ndex.html");
     }
     if ((fileSystemEntries == null) || (fileSystemEntries.Length < 1))
     {
         fileSystemEntries = Directory.GetFileSystemEntries(AppHost.Path, "?ndex.htm");
     }
     if ((fileSystemEntries != null) && (fileSystemEntries.Length > 0))
     {
         _defaultDoc = Path.GetFileName(fileSystemEntries[0]);
     }
 }
示例#2
0
文件: AspNet.cs 项目: zr8091/OwinDog
 private static void CreateAspApplicationHost()
 {
     //创建并配置用于承载 ASP.NET 的应用程序域。
     _appHost = (AspApplicationHost)ApplicationHost.CreateApplicationHost(typeof(AspApplicationHost), "/", _pPath);
     _appHost.SetRequestBroker(_broker);
     //请求执行委托
     _appFunc = new AppFunc(_appHost.Process);
 }
示例#3
0
文件: AspNet.cs 项目: zr8091/OwinDog
 /// <summary>
 /// 卸载
 /// </summary>
 private static void AspUnload()
 {
     _aspunloading = true;
     Console.WriteLine(" * Asp Applicaton unload.....");
     _appHost = null;
     _appFunc = null;
     if (_tasks.Count > 0)
     {
         foreach (ReqInfo info in _tasks.Values)
         {
             info.RequestWorkTask.SetCanceled();
         }
         _tasks.Clear();
     }
     _aspunloading = false;
 }