Ejemplo n.º 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]);
     }
 }
Ejemplo n.º 2
0
        static AspNet()
        {
            //工作路径
            Environment.CurrentDirectory = AppDomain.CurrentDomain.BaseDirectory;

            //执行代理
            _broker = new AspRequestBroker(new AspRequestBroker.DelegateRead(AspNet.Read), new AspRequestBroker.DelegateWrite(AspNet.Write), new AspRequestBroker.DelegateWriteHeader(AspNet.WriteHeader), new AspRequestBroker.DelegateWriteHttpStatus(AspNet.WriteStatus), new AspRequestBroker.DelegateRequestEnd(AspNet.RequestEnd), new AspRequestBroker.DelegateDomainUnload(AspNet.AspUnload));
        }
Ejemplo n.º 3
0
 public void SetRequestBroker(AspRequestBroker broker)
 {
     this._requestBroker = broker;
     AspRequestWorker.Init(this, broker);
 }