예제 #1
0
        internal ICSConnection(INetSharingManager nsManager, INetConnection netConnection)
        {
            if (nsManager == null)
            {
                throw new ArgumentNullException("nsManager");
            }

            if (netConnection == null)
            {
                throw new ArgumentNullException("netConnection");
            }

            this._netConnectionProperties = nsManager.NetConnectionProps[netConnection];
            this._netSharingConfiguration = nsManager.INetSharingConfigurationForINetConnection[netConnection];
        }
예제 #2
0
        internal ICSConnection(INetSharingManager nsManager, INetConnection netConnection)
        {
            if (nsManager == null)
            {
                throw new ArgumentNullException("nsManager");
            }

            if (netConnection == null)
            {
                throw new ArgumentNullException("netConnection");
            }

            this._netConnectionProperties = nsManager.NetConnectionProps[netConnection];
            this._netSharingConfiguration = nsManager.INetSharingConfigurationForINetConnection[netConnection];
        }
예제 #3
0
        internal ICSManager()
        {
            _netSharingManager = new NetSharingManager();

            if (!_netSharingManager.SharingInstalled)
            {
                string message;
                message = Environment.OSVersion.Version.Major == 5
                    ? "The operating system doesn't support connection sharing"
                    : "ICS requires elevated privilege";
                Logger.Error(".ctor: {0}", message);
                throw new ICSException(message);
            }

            _icsService = new ServiceController("SharedAccess");
        }
예제 #4
0
        internal ICSManager()
        {
            _netSharingManager = new NetSharingManager();

            if (!_netSharingManager.SharingInstalled)
            {
                string message;
                message = Environment.OSVersion.Version.Major == 5
                    ? "The operating system doesn't support connection sharing"
                    : "ICS requires elevated privilege";
                Logger.Error(".ctor: {0}", message);
                throw new ICSException(message);
            }

            _icsService = new ServiceController("SharedAccess");
        }
예제 #5
0
 public IcsConnection(INetSharingManager pIcsMgr, INetConnection pNetConnection)
 {
     this.INetConnection = pNetConnection;
     this._NSManager = pIcsMgr;
 }
예제 #6
0
 public IcsConnection(INetSharingManager pIcsMgr, INetConnection pNetConnection)
 {
     this.INetConnection = pNetConnection;
     this._NSManager     = pIcsMgr;
 }
예제 #7
0
 public void Init()
 {
     this._NSManager = new NetSharingManagerClass();
 }
예제 #8
0
 public void Init()
 {
     this._NSManager = new NetSharingManagerClass();
 }
예제 #9
0
 public void Init()
 {
     _NSManager = new NetSharingManager();
 }