国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計 > 正文

Web服務(wù)器(CassiniDev的裁減版)

2019-11-17 03:20:50
字體:
供稿:網(wǎng)友

Web服務(wù)器(CassiniDev的裁減版)

做此程序的原因是將軟件部署簡化,省去IIS的麻煩部署,減少項(xiàng)目實(shí)施人員的工作量和工作復(fù)雜度

Server sv = new Server(8000, "/", @"D:/web", ipAddress.Any, null, "Login.aspx");
//  **********************************************************************************//  CassiniDev - http://cassinidev.codeplex.com// //  Copyright (c) 2010 Sky Sanders. All rights reserved.//  Copyright (c) Microsoft Corporation. All rights reserved.//  //  This source code is subject to terms and conditions of the Microsoft Public//  License (Ms-PL). A copy of the license can be found in the license.txt file//  included in this distribution.//  //  You must not remove this notice, or any other, from this software.//  //  **********************************************************************************#regionusing System;using System.Collections.Generic;using System.Diagnostics;using System.Globalization;using System.IO;using System.Net;using System.Net.Sockets;using System.Reflection;using System.Runtime.Remoting;using System.Security.Permissions;using System.Security.PRincipal;using System.Text;using System.Threading;using System.Web;using System.Web.Hosting;#endregionnamespace SimpleWebServer{    ///<summary>    ///</summary>    [PermissionSet(SecurityAction.LinkDemand, Name = "Everything"),     PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")]    public class Server : MarshalByRefObject, IDisposable    {        ///<summary>        ///</summary>        public List<string> Plugins = new List<string>();        ///<summary>        ///</summary>        public readonly applicationManager ApplicationManager;        private readonly bool _disableDirectoryListing;        private readonly string _hostName;        private readonly IPAddress _ipAddress;        private readonly object _lockObject;        private readonly string _physicalPath;        private readonly int _port;        private readonly bool _requireAuthentication;        //private readonly int _timeoutInterval;        private readonly string _virtualPath;        private bool _disposed;        private Host _host;        private IntPtr _processToken;        private string _processUser;        //private int _requestCount;        private bool _shutdownInProgress;        private Socket _socket;        //private Timer _timer;        private string _appId;        private string _dfPage;        ///<summary>        ///</summary>        public string AppId        {            get { return _appId; }        }        ///<summary>        ///</summary>        public AppDomain HostAppDomain        {            get            {                if (_host == null)                {                    GetHost();                }                if (_host != null)                {                    return _host.AppDomain;                }                return null;            }        }        ///<summary>        ///</summary>        ///<param name="port"></param>        ///<param name="virtualPath"></param>        ///<param name="physicalPath"></param>        public Server(int port, string virtualPath, string physicalPath)            : this(port, virtualPath, physicalPath, false, false)        {        }        ///<summary>        ///</summary>        ///<param name="port"></param>        ///<param name="physicalPath"></param>        public Server(int port, string physicalPath)            : this(port, "/", physicalPath, IPAddress.Loopback)        {        }        ///<summary>        ///</summary>        ///<param name="port"></param>        ///<param name="virtualPath"></param>        ///<param name="physicalPath"></param>        ///<param name="ipAddress"></param>        ///<param name="hostName"></param>        ///<param name="requireAuthentication"></param>        public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName)            : this(port, virtualPath, physicalPath, ipAddress, hostName,false, false, null)        {        }        ///<summary>        ///</summary>        ///<param name="port"></param>        ///<param name="virtualPath"></param>        ///<param name="physicalPath"></param>        ///<param name="requireAuthentication"></param>        public Server(int port, string virtualPath, string physicalPath, bool requireAuthentication)            : this(port, virtualPath, physicalPath, requireAuthentication, false)        {        }        ///<summary>        ///</summary>        ///<param name="port"></param>        ///<param name="virtualPath"></param>        ///<param name="physicalPath"></param>        ///<param name="ipAddress"></param>        ///<param name="hostName"></param>        public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName,string dfPage)            : this(port, virtualPath, physicalPath, ipAddress, hostName, false, false, dfPage)        {        }        ///<summary>        ///</summary>        ///<param name="port"></param>        ///<param name="virtualPath"></param>        ///<param name="physicalPath"></param>        ///<param name="ipAddress"></param>        ///<param name="hostName"></param>        ///<param name="requireAuthentication"></param>        ///<param name="disableDirectoryListing"></param>        public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress, string hostName,                      bool requireAuthentication, bool disableDirectoryListing, string dfPage)            : this(port, virtualPath, physicalPath, requireAuthentication, disableDirectoryListing)        {            _ipAddress = ipAddress;            _hostName = hostName;            if (!String.IsNullOrEmpty(dfPage))                dfPage.TrimStart('/');            _dfPage = "/" + dfPage;            //_timeoutInterval = timeout;        }        ///<summary>        ///</summary>        ///<param name="port"></param>        ///<param name="virtualPath"></param>        ///<param name="physicalPath"></param>        ///<param name="ipAddress"></param>        public Server(int port, string virtualPath, string physicalPath, IPAddress ipAddress)            : this(port, virtualPath, physicalPath, ipAddress, null, false, false , null)        {        }        ///<summary>        ///</summary>        ///<param name="port"></param>        ///<param name="virtualPath"></param>        ///<param name="physicalPath"></param>        ///<param name="requireAuthentication"></param>        ///<param name="disableDirectoryListing"></param>        public Server(int port, string virtualPath, string physicalPath, bool requireAuthentication,                      bool disableDirectoryListing)        {            try            {                Assembly.ReflectionOnlyLoad("Common.Logging");            }            // ReSharper disable EmptyGeneralCatchClause            catch            // ReSharper restore EmptyGeneralCatchClause            {            }            _ipAddress = IPAddress.Loopback;            _requireAuthentication = requireAuthentication;            _disableDirectoryListing = disableDirectoryListing;            _lockObject = new object();            _port
發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 南雄市| 房山区| 遂川县| 湖州市| 阜城县| 桐城市| 渭源县| 长泰县| 台南市| 新宁县| 合肥市| 安丘市| 宿迁市| 临漳县| 民乐县| 犍为县| 湖口县| 九龙县| 昭平县| 滕州市| 博乐市| 崇州市| 绥芬河市| 河间市| 陕西省| 瓮安县| 游戏| 周至县| 莱州市| 磴口县| 永清县| 宜良县| 南京市| 榕江县| 通榆县| 靖西县| 靖西县| 顺昌县| 清徐县| 华亭县| 张家界市|