Exemplo n.º 1
0
 internal void Import(TCPTerminalParam r)
 {
     base.Import(r);
     _host   = r._host;
     _port   = r._port;
     _method = r._method;
 }
Exemplo n.º 2
0
        public virtual IConnectionMethod SetConnectionMethod(string nodehost, ConnectionMethod method)
        {
            try
            {
                IConnectionMethod connectionMethod;

                switch (method)
                {
                case ConnectionMethod.RPC:
                    connectionMethod = new RPC(nodehost);
                    break;

                case ConnectionMethod.REST:
                    connectionMethod = new REST(nodehost);
                    break;

                case ConnectionMethod.Websocket:
                    connectionMethod = new Websocket(nodehost);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(method), method, null);
                }

                return(connectionMethod);
            }
            catch { throw; }
        }
Exemplo n.º 3
0
        public static UduinoConnection GetFinder(UduinoManager manager, Platform p, ConnectionMethod m)
        {
            UduinoConnection connection = null;

#if UNITY_ANDROID
    #if UNITY_EDITOR //IF it's on the editor
            UduinoExtension u;
            if (manager.AvailableExtensions["UduinoDevice_AndroidSerial"].isActive)
            {
                Log.Info("Uduino for Android Serial is active but you are in the editor. Switching platform.");
            }
            connection = new UduinoConnection_DesktopSerial();
#else //Get the  Android Serial Plugin
            if (UduinoManager.Instance.AvailableExtensions["UduinoDevice_AndroidSerial"].isPresent)
            {
                if (UduinoManager.Instance.AvailableExtensions["UduinoDevice_AndroidSerial"].isActive)
                {
                    connection = new UduinoConnection_AndroidSerial();
                }
                else
                {
                    Log.Error("Uduino for Android Serial is not active ! Activate it in the Inspector Panel");
                }
            }
            else
            {
                Log.Error("Uduino for Android Serial is not present ! Are you sure it's imported in your project ?");
            }
#endif
#else // default
            connection = new UduinoConnection_DesktopSerial();
#endif
            return(connection);
        }
Exemplo n.º 4
0
    //public void ChangeTestingStatus()
    //{
    //	isTesting = testingToggle.isOn;
    //}
    //public void ChangeLearningStatus()
    //{
    //	isLearning = learningToggle.isOn;
    //}
    //public void ChangeReevalStatus()
    //{
    //	isReeval = reevalToggle.isOn;
    //}
    //public void ChangeTrainingStatus()
    //{
    //	isTraining = trainingToggle.isOn;
    //}


    public void SetConnectionMethod()
    {
        Debug.Log("setting connection method: " + connectionMethodDropdown.value.ToString());
        switch (connectionMethodDropdown.value)
        {
        case 0:
            connectionMethod = ConnectionMethod.BlackrockSync;
            break;

        case 1:
            connectionMethod = ConnectionMethod.Syncbox;
            break;

        case 2:
            connectionMethod = ConnectionMethod.Photosync;
            break;

        case 3:
            connectionMethod = ConnectionMethod.Demo;
            break;

        default:
            connectionMethod = ConnectionMethod.BlackrockSync;
            break;
        }

        //then update the connection method
        UpdateConnectionMethod();
    }
        private bool TestConnection(out string message, bool saveSettings = true, int retries = 1)
        {
            message = null;
            for (int attempt = 0; attempt < retries; attempt++)
            {
                try
                {
                    using (var cn = ConnectionMethod.Invoke(GetConnectionString()))
                    {
                        cn.Open();
                        cn.Close();
                        if (saveSettings)
                        {
                            var server = _settings.AddServer(cbServer.Text);
                            if (rbAuthenticationDb.Checked)
                            {
                                server.AddUser(cbUser.Text, tbPassword.Text);
                            }
                        }
                        return(true);
                    }
                }
                catch (Exception exc)
                {
                    message = exc.Message;
                    if (retries > 1)
                    {
                        Thread.Sleep(250);
                    }
                }
            }

            return(false);
        }
Exemplo n.º 6
0
 public override void Import(ConfigNode data)
 {
     _host   = data["host"];
     _port   = ParsePort(data["port"]);
     _method = ParseMethod(data["method"]);
     base.Import(data);
 }
Exemplo n.º 7
0
        public static UduinoConnection GetFinder(UduinoManager manager, Platform p, ConnectionMethod m)
        {
            UduinoConnection connection = null;

#if UNITY_EDITOR || UNITY_STANDALONE //IF it's on the editor
            if (manager.activeExtentionsMap.ContainsValue(true))
            {
                connection = new UduinoConnection_DesktopSerial();
            }
#elif UNITY_ANDROID //Get the  Android Serial Plugin
            if (manager.ExtensionIsPresentAndActive("UduinoDevice_AndroidBluetoothLE"))
            {
                connection = new UduinoConnection_AndroidBluetoothLE();
            }
            else if (manager.ExtensionIsPresentAndActive("UduinoDevice_AndroidSerial"))
            {
                connection = new UduinoConnection_AndroidSerial();
            }
            else
            {
                Log.Error("Uduino for Android is not active ! Activate it in the Inspector Panel.");
            }
#else
#endif

            return(connection);
        }
Exemplo n.º 8
0
 internal TCPTerminalParam(TCPTerminalParam r)
     : base(r)
 {
     _host   = r._host;
     _port   = r._port;
     _method = r._method;
 }
Exemplo n.º 9
0
        /// <summary>
        /// 掲示板画面(リダイレクト用)
        /// </summary>
        /// <returns></returns>
        public ActionResult Thread()
        {
            ConnectionMethod method = new ConnectionMethod();
            var articles            = method.GetArticles();

            return(View(articles));
        }
Exemplo n.º 10
0
        public TerminalControl(string UserName, string Password, string Hostname, ConnectionMethod Method)
        {
            this._connectionMethod = Method;
            this._hostname         = Hostname;
            this._password         = Password;
            this._username         = UserName;

            this.InitializeTerminalPane();
        }
Exemplo n.º 11
0
 public EsMount(MountModel model, ConnectionMethod ipProtocol, string ipAddress, int ipPort)
 {
     //For creating withTCP or UDP
     this.MountModel         = model;
     DesiredConnectionMethod = ipProtocol;
     this.IpProtocol         = ipProtocol;
     IpAddress   = ipAddress;
     this.IpPort = ipPort.ToString();
 }
Exemplo n.º 12
0
 public PRM(Vector3 bounds, OccupancyGrid occupancy, float radius, int neighbours, ConnectionMethod method)
 {
     graph = new StateConfGraph();
     this.bounds = bounds;
     this.occupancy = occupancy;
     this.radius = radius;
     this.neighbours = neighbours;
     this.method = method;
     this.search = new AStar();
 }
Exemplo n.º 13
0
 //                     CONSTRUCTORS
 public EsMount(MountModel model, string commPort)
 {
     if (commPort == "")
     {
         throw new ApplicationException("Mount must have valid com port.");
     }
     //For creating with a serial connection
     this.MountModel = model;
     this.ComPort    = commPort;
     this.DesiredConnectionMethod = ConnectionMethod.Serial;
 }
Exemplo n.º 14
0
        public ActionResult Thread(string contents)
        {
            User user = new User();

            user = (User)Session["userInfo"];

            ConnectionMethod method = new ConnectionMethod();

            method.AddThread(user, contents);

            return(View());
        }
Exemplo n.º 15
0
        public ModbusRTUDevice(byte unitId, ConnectionMethod connectionMethod, string remoteHost, int port, int timeout = 2000, int retries = 1, int?delayBetweenMessages = null)
        {
            if (connectionMethod == ConnectionMethod.SerialOverLAN && unitId == 0)
            {
                throw new ArgumentOutOfRangeException(nameof(unitId), "The Unit ID for a Serial Over LAN Modbus Device cannot be '0'");
            }

            if (connectionMethod == ConnectionMethod.SerialOverLAN && unitId == 255)
            {
                throw new ArgumentOutOfRangeException(nameof(unitId), "The Unit ID for a Serial Over LAN Modbus Device cannot be '255'");
            }

            _unitId = unitId;

            _connectionMethod = connectionMethod;

            if (remoteHost == null)
            {
                throw new ArgumentNullException(nameof(remoteHost), "The Remote Host cannot be Null");
            }

            if (remoteHost.Length == 0)
            {
                throw new ArgumentException("The Remote Host cannot be Empty", nameof(remoteHost));
            }

            _remoteHost = remoteHost;

            if (port <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(port), "The Port cannot be less than 1");
            }

            _port = port;

            if (timeout <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(timeout), "The Timeout Value cannot be less than 1");
            }

            _timeout = timeout;

            if (retries < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(retries), "The Retries Value cannot be Negative");
            }

            _retries = retries;

            _delayBetweenMessages = delayBetweenMessages;

            _internalUniqueId = Guid.NewGuid();
        }
Exemplo n.º 16
0
 /// <summary>Returns a collection containing the properties that are required by the specified <see cref="ConnectionMethod"/>.</summary>
 public static IEnumerable <PropertyInfo> GetPropertiesForMethod(ConnectionMethod method)
 {
     return(typeof(AntiFraud)
            .GetProperties()
            .Where(x => {
         return (x.GetCustomAttribute <AntiFraudHeaderAttribute>() != null) &&
         (
             x.Name == nameof(ConnectionMethod) ||
             x.GetCustomAttributes <ConnectionMethodAttribute>().Any(a => a.IsRequired(method))
         );
     }));
 }
        public SPOnlineConnection(TokenResult tokenResult, ConnectionMethod connectionMethod, ConnectionType connectionType, int minimalHealthScore, int retryCount, int retryWait, string pnpVersionTag)
        {
            TokenResult = tokenResult;
            var coreAssembly = Assembly.GetExecutingAssembly();

            userAgent          = $"NONISV|SharePointPnP|PnPPS/{((AssemblyFileVersionAttribute)coreAssembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute))).Version}";
            ConnectionType     = connectionType;
            MinimalHealthScore = minimalHealthScore;
            RetryCount         = retryCount;
            RetryWait          = retryWait;
            PnPVersionTag      = pnpVersionTag;
            ConnectionMethod   = ConnectionMethod;
        }
Exemplo n.º 18
0
        internal PnPConnection(GenericToken tokenResult, ConnectionMethod connectionMethod, ConnectionType connectionType, string pnpVersionTag, bool disableTelemetry, InitializationType initializationType)
        {
            if (!disableTelemetry)
            {
                InitializeTelemetry(null, initializationType);
            }
            var coreAssembly = Assembly.GetExecutingAssembly();

            UserAgent        = $"NONISV|SharePointPnP|PnPPS/{((AssemblyFileVersionAttribute)coreAssembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute))).Version}";
            ConnectionType   = connectionType;
            PnPVersionTag    = pnpVersionTag;
            ConnectionMethod = connectionMethod;
        }
Exemplo n.º 19
0
        public static UduinoConnection GetFinder(UduinoManager manager, Platform p, ConnectionMethod m)
        {
            UduinoConnection connection = null;

#if UNITY_EDITOR || UNITY_STANDALONE //IF it's on the editor
            if (manager.activeExtentionsMap.ContainsValue(true))
            {
                if (manager.ExtensionIsPresentAndActive("UduinoDevice_DesktopBluetoothLE"))
                {
                    connection = System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("Uduino.UduinoConnection_DesktopBluetoothLE") as UduinoConnection;
                }
                else if (manager.ExtensionIsPresentAndActive("UduinoDevice_Wifi"))
                {
                    connection = System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("Uduino.UduinoConnection_Wifi") as UduinoConnection;
                }
                else
                {
                    connection = new UduinoConnection_DesktopSerial();
                }
            }
            else
            {
#if UNITY_EDITOR
                Log.Warning("No build platform selected");
                return(null);
#else
                return(connection = new UduinoConnection_DesktopSerial()); // Fix for Build
#endif
            }
#elif UNITY_ANDROID //Get the  Android Serial Plugin
            if (manager.ExtensionIsPresentAndActive("UduinoDevice_AndroidBluetoothLE"))
            {
                connection = new UduinoConnection_AndroidBluetoothLE();
            }
            else if (manager.ExtensionIsPresentAndActive("UduinoDevice_AndroidSerial"))
            {
                connection = new UduinoConnection_AndroidSerial();
            }
            else if (manager.ExtensionIsPresentAndActive("UduinoDevice_Wifi"))
            {
                connection = new UduinoConnection_Wifi();
            }
            else
            {
                Log.Error("Uduino for Android is not active ! Activate it in the Inspector Panel.");
            }
#endif
            Log.Debug("Starting Uduino with type: " + connection.GetType());

            return(connection);
        }
Exemplo n.º 20
0
 /// <summary>
 /// <ja>ホスト名、アカウント、パスワードを指定して作成します。</ja>
 /// <en>Initializes with the host name, the account, and the password.</en>
 /// <seealso cref="Poderosa.Macro.ConnectionList.Open"/>
 /// </summary>
 /// <remarks>
 /// <ja>ポートは22に設定されます。</ja>
 /// <en>The port number is set to 22.</en>
 /// <ja>他のパラメータは次のように初期化されます。</ja>
 /// <en>Other parameters are initialized as following:</en>
 /// <list type="table">
 ///   <item><term><ja>エンコーディング</ja><en>Encoding</en></term><description><ja>EUC-JP</ja><en>iso-8859-1</en></description></item> 
 ///   <item><term><ja>ターミナルタイプ</ja><en>Terminal Type</en></term><description>xterm</description></item>
 ///   <item><term><ja>ログ</ja><en>Log</en></term><description><ja>取得しない</ja><en>None</en></description></item>       
 ///   <item><term><ja>ローカルエコー</ja><en>Local echo</en></term><description><ja>しない</ja><en>Don't</en></description></item>  
 ///   <item><term><ja>送信時改行</ja><en>New line</en></term><description>CR</description></item>    
 ///   <item><term><ja>認証方法</ja><en>Authentication Method</en></term><description><ja>パスワード</ja><en>Password</en></description></item>    
 /// </list>
 /// <ja>接続を開くには、ConnectionListオブジェクトの<see cref="Poderosa.Macro.ConnectionList.Open"/>メソッドの引数としてSSHTerminalParamオブジェクトを渡します。</ja>
 /// <en>To open a new connection, pass the SSHTerminalParam object to the <see cref="Poderosa.Macro.ConnectionList.Open"/> method of the ConnectionList object.</en>
 /// </remarks>
 /// <param name="method"><ja>SSH1またはSSH2</ja><en>SSH1 or SSH2.</en></param>
 /// <param name="host"><ja>ホスト名</ja><en>The host name.</en></param>
 /// <param name="account"><ja>アカウント名</ja><en>The account</en></param>
 /// <param name="password"><ja>パスワードまたは秘密鍵のパスフレーズ</ja><en>The password or the passphrase of the private key.</en></param>
 public SSHTerminalParam(ConnectionMethod method, string host, string account, string password)
 {
     if (method == ConnectionMethod.Telnet)
     {
         throw new ArgumentException("Telnet is specified in the constructor of SSHTerminalParam");
     }
     _method       = method;
     _host         = host;
     _port         = 22;
     _account      = account;
     _passphrase   = password;
     _auth         = AuthType.Password;
     _identityfile = "";
 }
Exemplo n.º 21
0
        /// <summary>
        /// オブジェクトを有効/無効化(オブジェクト共通)
        /// </summary>
        private void EnableValidControls(object sender, EventArgs e)
        {
            if (_Initialized == true)
            {
                ConnectionMethod        protocol     = ((ListItem <ConnectionMethod>)_protocolBox.SelectedItem).Value;
                EnumListItem <AuthType> authTypeItem = (EnumListItem <AuthType>)_authTypeBox.SelectedItem;
                EnumListItem <NewLine>  newLineItem  = (EnumListItem <NewLine>)_newLineTypeBox.SelectedItem;
                bool autologin = (_autoLoginCheck.Checked);
                bool ssh       = (protocol == ConnectionMethod.SSH1 || protocol == ConnectionMethod.SSH2);
                bool pubkey    = (authTypeItem != null && authTypeItem.Value == AuthType.PublicKey);
                bool kbd       = (authTypeItem != null && authTypeItem.Value == AuthType.KeyboardInteractive);
                bool newline   = (newLineItem != null && newLineItem.Value == NewLine.CRLF);
                bool su        = (_suUserNameBox.Text != "");

                // ユーザ名/パスワード
                _userNameBox.Enabled = (ssh || autologin);
                _passwordBox.Enabled = autologin;

                // 自動ログイン用プロンプト
                _loginPromptBox.Enabled    = (autologin && !ssh);
                _passwordPromptBox.Enabled = ((autologin && !ssh) || (autologin && su));

                // 秘密鍵ファイル
                _authTypeBox.Enabled       = ssh;
                _keyFileBox.Enabled        = (ssh && pubkey);
                _openKeyFileButton.Enabled = (ssh && pubkey);

                // 実行コマンド
                _execCommandBox.Enabled = autologin;

                // SU
                _suUserNameBox.Enabled = autologin;
                _suPasswordBox.Enabled = (su && autologin);
                _suTypeRadio1.Enabled  = (su && autologin);
                _suTypeRadio2.Enabled  = (su && autologin);
                _suTypeRadio3.Enabled  = (su && autologin);
                _suTypeRadio4.Enabled  = (su && autologin);

                // TelnetNewLine
                _telnetNewLineCheck.Enabled = (!ssh && newline);

                // コマンド発行間隔/プロンプト受信タイムアウト
                _commandSendIntBox.Enabled    = autologin;
                _promptRecvTimeoutBox.Enabled = autologin;

                // ポート番号
                _portBox.Value = ssh ? ConnectProfileStruct.DEFAULT_SSH_PORT : ConnectProfileStruct.DEFAULT_TELNET_PORT;
            }
        }
Exemplo n.º 22
0
        internal PnPConnection(ConnectionMethod connectionMethod, ConnectionType connectionType, int minimalHealthScore, int retryCount, int retryWait, string pnpVersionTag, PSHost host, bool disableTelemetry, InitializationType initializationType)
        {
            if (!disableTelemetry)
            {
                InitializeTelemetry(null, host, initializationType);
            }
            var coreAssembly = Assembly.GetExecutingAssembly();

            UserAgent          = $"NONISV|SharePointPnP|PnPPS/{((AssemblyFileVersionAttribute)coreAssembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute))).Version}";
            ConnectionType     = connectionType;
            MinimalHealthScore = minimalHealthScore;
            RetryCount         = retryCount;
            RetryWait          = retryWait;
            PnPVersionTag      = pnpVersionTag;
            ConnectionMethod   = connectionMethod;
        }
 private bool TestConnectionWithoutDatabase()
 {
     try
     {
         string connectionString = GetConnectionWithoutDatabase();
         using (var cn = ConnectionMethod.Invoke(connectionString))
         {
             cn.Open();
             cn.Close();
             return(true);
         }
     }
     catch
     {
         return(false);
     }
 }
        private async void llCreateDb_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                using (var cn = ConnectionMethod.Invoke(GetConnectionWithoutDatabase()))
                {
                    await CreateDatabaseMethod.Invoke(cn, cbDatabase.Text);

                    if (TestConnection(out string message, retries: 30))
                    {
                        MessageBox.Show("Database created successfully.");
                    }
                    else
                    {
                        MessageBox.Show("Database create field: " + message);
                    }
                }
 private void FillDatabaseList()
 {
     cbDatabase.Items.Clear();
     if (TestConnectionWithoutDatabase())
     {
         llCreateDb.Visible = false;
         using (var cn = ConnectionMethod.Invoke(GetConnectionWithoutDatabase()))
         {
             var databases = (GetDatabaseListMethod?.Invoke(cn) ?? Enumerable.Empty <string>()).ToArray();
             cbDatabase.Items.Clear();
             cbDatabase.Items.AddRange(databases);
         }
     }
     else
     {
         llCreateDb.Visible = true;
     }
 }
        private async Task FillDatabaseListAsync()
        {
            cbDatabase.Items.Clear();
            if (TestConnectionWithoutDatabase())
            {
                llCreateDb.Visible = false;
                using (var cn = ConnectionMethod.Invoke(GetConnectionWithoutDatabase()))
                {
                    var databases = await ListDatabasesMethod.Invoke(cn);

                    cbDatabase.Items.Clear();
                    cbDatabase.Items.AddRange(databases?.ToArray());
                }
            }
            else
            {
                llCreateDb.Visible = true;
            }
        }
Exemplo n.º 27
0
        public ActionResult Login(User user)
        {
            if (user == null)
            {
                return(View());
            }

            ConnectionMethod conMethod = new ConnectionMethod();

            var getUser = conMethod.GetUser(user);

            if (getUser == null)
            {
                return(View());
            }
            else
            {
                Session["userInfo"] = user;

                return(RedirectToAction("Menu", "Menu"));
            }
        }
Exemplo n.º 28
0
        public static UduinoConnection GetFinder(UduinoManager manager, Platform p, ConnectionMethod m)
        {
            UduinoConnection connection = null;

#if UNITY_EDITOR || UNITY_STANDALONE //IF it's on the editor
            if (manager.activeExtentionsMap.ContainsValue(true))
            {
                if (manager.ExtensionIsPresentAndActive("UduinoDevice_DesktopBluetoothLE"))
                {
                    connection = System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("Uduino.UduinoConnection_DesktopBluetoothLE") as UduinoConnection;
                }
                else if (manager.ExtensionIsPresentAndActive("UduinoDevice_Wifi"))
                {
                    connection = System.Reflection.Assembly.GetExecutingAssembly().CreateInstance("Uduino.UduinoConnection_Wifi") as UduinoConnection;
                }
                else
                {
                    connection = new UduinoConnection_DesktopSerial();
                }
            }
            else
            {
                return(null);
            }
#elif UNITY_ANDROID //Get the  Android Serial Plugin
            if (manager.ExtensionIsPresentAndActive("UduinoDevice_AndroidBluetoothLE"))
            {
                connection = new UduinoConnection_AndroidBluetoothLE();
            }
            else if (manager.ExtensionIsPresentAndActive("UduinoDevice_AndroidSerial"))
            {
                connection = new UduinoConnection_AndroidSerial();
            }
            else if (manager.ExtensionIsPresentAndActive("UduinoDevice_Wifi"))
            {
                connection = new UduinoConnection_Wifi();
            }
        }
Exemplo n.º 29
0
        public TerminalControl(string UserName, string Password, string Hostname, ConnectionMethod Method)
        {
            this._connectionMethod = Method;
            this._hostname = Hostname;
            this._password = Password;
            this._username = UserName;

            this.InitializeTerminalPane();
        }
Exemplo n.º 30
0
    // Static methods

    /// <summary> Check whether or not a glove with a particular handed-ness mathces a connection method. </summary>
    /// <param name="rightHand"></param>
    /// <param name="method"></param>
    /// <returns></returns>
    public static bool MatchesConnection(bool rightHand, ConnectionMethod method)
    {
        return(method == ConnectionMethod.NextGlove ||
               (rightHand && method == ConnectionMethod.NextRightHand) ||
               (!rightHand && method == ConnectionMethod.NextLeftHand));
    }
Exemplo n.º 31
0
        internal string _passphrase; //����̓V���A���C�Y�̑ΏۊO�B��������Ɏ��‚��ǂ�����I�v�V����

        #endregion Fields

        #region Constructors

        /// <summary>
        /// <ja>�z�X�g���A�A�J�E���g�A�p�X���[�h��w�肵�č쐬���܂��B</ja>
        /// <en>Initializes with the host name, the account, and the password.</en>
        /// <seealso cref="Poderosa.Macro.ConnectionList.Open"/>
        /// </summary>
        /// <remarks>
        /// <ja>�|�[�g��22�ɐݒ肳��܂��B</ja>
        /// <en>The port number is set to 22.</en>
        /// <ja>���̃p�����[�^�͎��̂悤�ɏ���������܂��B</ja>
        /// <en>Other parameters are initialized as following:</en>
        /// <list type="table">
        ///   <item><term><ja>�G���R�[�f�B���O</ja><en>Encoding</en></term><description><ja>EUC-JP</ja><en>iso-8859-1</en></description></item>�@
        ///   <item><term><ja>�^�[�~�i���^�C�v</ja><en>Terminal Type</en></term><description>xterm</description></item>  
        ///   <item><term><ja>���O</ja><en>Log</en></term><description><ja>�擾���Ȃ�</ja><en>None</en></description></item>�@�@�@�@�@�@�@
        ///   <item><term><ja>���[�J���G�R�[</ja><en>Local echo</en></term><description><ja>���Ȃ�</ja><en>Don't</en></description></item>�@�@
        ///   <item><term><ja>���M�����s</ja><en>New line</en></term><description>CR</description></item>�@�@�@�@
        ///   <item><term><ja>�F�ؕ��@</ja><en>Authentication Method</en></term><description><ja>�p�X���[�h</ja><en>Password</en></description></item>�@�@�@�@
        /// </list>
        /// <ja>�ڑ���J���ɂ́AConnectionList�I�u�W�F�N�g��<see cref="Poderosa.Macro.ConnectionList.Open"/>���\�b�h�̈����Ƃ���SSHTerminalParam�I�u�W�F�N�g��n���܂��B</ja>
        /// <en>To open a new connection, pass the SSHTerminalParam object to the <see cref="Poderosa.Macro.ConnectionList.Open"/> method of the ConnectionList object.</en>
        /// </remarks>
        /// <param name="method"><ja>SSH1�܂���SSH2</ja><en>SSH1 or SSH2.</en></param>
        /// <param name="host"><ja>�z�X�g��</ja><en>The host name.</en></param>
        /// <param name="account"><ja>�A�J�E���g��</ja><en>The account</en></param>
        /// <param name="password"><ja>�p�X���[�h�܂��͔閧���̃p�X�t���[�Y</ja><en>The password or the passphrase of the private key.</en></param>
        public SSHTerminalParam(ConnectionMethod method, string host, string account, string password)
        {
            if(method==ConnectionMethod.Telnet) throw new ArgumentException("Telnet is specified in the constructor of SSHTerminalParam");
            _method = method;
            _host = host;
            _port = 22;
            _account = account;
            _passphrase = password;
            _auth = AuthType.Password;
        }
Exemplo n.º 32
0
 public override void Import(ConfigNode data)
 {
     _host = data["host"];
     _port = ParsePort(data["port"]);
     _method = ParseMethod(data["method"]);
     base.Import(data);
 }
Exemplo n.º 33
0
 internal void Import(TCPTerminalParam r)
 {
     base.Import(r);
     _host = r._host;
     _port = r._port;
     _method = r._method;
 }
Exemplo n.º 34
0
 internal TCPTerminalParam(TCPTerminalParam r)
     : base(r)
 {
     _host = r._host;
     _port = r._port;
     _method = r._method;
 }
Exemplo n.º 35
0
 internal TCPTerminalParam()
 {
     _method = ConnectionMethod.Telnet;
 }
Exemplo n.º 36
0
        //入力内容に誤りがあればそれを警告してnullを返す。なければ必要なところを埋めたTCPTerminalParamを返す
        private TCPTerminalParam ValidateContent()
        {
            string           msg = null;
            TCPTerminalParam p   = null;
            SSHTerminalParam sp  = null;

            try {
                ConnectionMethod m = ParseMethod(_methodBox.Text);
                if (m == ConnectionMethod.Telnet)
                {
                    p = new TelnetTerminalParam("");
                }
                else
                {
                    p          = sp = new SSHTerminalParam(ConnectionMethod.SSH2, "", "", "");
                    sp.Method  = m;
                    sp.Account = _userNameBox.Text;
                }

                p.Host = _hostBox.Text;
                try {
                    p.Port = ParsePort(_portBox.Text);
                }
                catch (FormatException ex) {
                    msg = ex.Message;
                }

                if (_hostBox.Text.Length == 0)
                {
                    msg = GApp.Strings.GetString("Message.LoginDialog.HostIsEmpty");
                }

                p.LogType = (LogType)EnumDescAttributeT.For(typeof(LogType)).FromDescription(_logTypeBox.Text, LogType.None);

                if (p.LogType != LogType.None)
                {
                    p.LogPath = _logFileBox.Text;
                    if (p.LogPath == GUtil.CreateLogFileName(null))
                    {
                        p.LogPath = GUtil.CreateLogFileName(_hostBox.Text);
                    }
                    LogFileCheckResult r = GCUtil.CheckLogFileName(p.LogPath, this);
                    if (r == LogFileCheckResult.Cancel || r == LogFileCheckResult.Error)
                    {
                        return(null);
                    }
                    p.LogAppend = (r == LogFileCheckResult.Append);
                }

                if (p.IsSSH)
                {
                    Debug.Assert(sp != null);
                    sp.AuthType = (AuthType)_authOptions.SelectedIndex;
                    if (sp.AuthType == AuthType.PublicKey)
                    {
                        if (!File.Exists(_privateKeyFile.Text))
                        {
                            msg = GApp.Strings.GetString("Message.LoginDialog.KeyFileNotExist");
                        }
                        else
                        {
                            sp.IdentityFile = _privateKeyFile.Text;
                        }
                    }
                }
                p.EncodingProfile = EncodingProfile.Get((EncodingType)_encodingBox.SelectedIndex);

                p.LocalEcho    = _localEchoBox.SelectedIndex == 1;
                p.TransmitNL   = (NewLine)EnumDescAttributeT.For(typeof(NewLine)).FromDescription(_newLineBox.Text, NewLine.CR);
                p.TerminalType = (TerminalType)_terminalTypeBox.SelectedIndex;

                if (msg != null)
                {
                    ShowError(msg);
                    return(null);
                }
                else
                {
                    return(p);
                }
            }
            catch (Exception ex) {
                GUtil.Warning(this, ex.Message);
                return(null);
            }
        }
Exemplo n.º 37
0
 internal TCPTerminalParam()
 {
     _method = ConnectionMethod.Telnet;
 }