Esempio n. 1
0
        public TinyVpnClient()
        {
            this.macAdd = "";
            this.userName = "******";
            this.passWord = "******";
            this.expiringDate = "";
            this.subscriptiontype = "";
            this.flagConnected = false;
            this.watcher = new RasConnectionWatcher();
            this.disconnected = true;
            this.ipaddressCounter = 0;
            this.initialized = false;
            this.publicIpAddress = "";
            this.kryptotelurl = "http://vpn.51sync.com";
            this.kryptotelurlbackup = "http://vpn.51sync.com";
            this.vpnoneclickurl = "http://vpn.51sync.com";

        }
Esempio n. 2
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects).
                    if (this._rasConnectionWatcher != null)
                    {
                        this._rasConnectionWatcher.Dispose();
                        this._rasConnectionWatcher = null;
                    }

                    if (this._rasPhoneBook != null)
                    {
                        this._rasPhoneBook.Dispose();
                        this._rasPhoneBook = null;
                    }

                    if (this._rasDialer != null)
                    {
                        this._rasDialer.Dispose();
                        this._rasDialer = null;
                    }
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Binds to existing IPSec VPN connection. 
        /// </summary>
        private void VpnConnectionBind()
        {
            this._rasDialer = new RasDialer();
            this._rasConnectionWatcher = new RasConnectionWatcher();

            //this._rasDialer.Credentials = null;
            //this._rasDialer.EapData = null;
            this._rasDialer.EapOptions = new RasEapOptions(false, false, false);
            this._rasDialer.HangUpPollingInterval = 0;
            this._rasDialer.Options =
                new RasDialOptions(false, false, false, false, false, false, false, false, false, false, false);
            this._rasDialer.DialCompleted += _rasDialer_DialCompleted;
            this._rasDialer.StateChanged += _rasDialer_StateChanged;

            this._rasConnectionWatcher.Handle = null;
            this._rasConnectionWatcher.Disconnected += _rasConnectionWatcher_Disconnected;
            this._rasConnectionWatcher.Connected += _rasConnectionWatcher_Connected;
            this._rasConnectionWatcher.Error += _rasConnectionWatcher_Error;
        }