public int CheckConn1(String Name) { SSHConnection ssh = new SSHConnection(); if (CheckExistence(Name) == true) { SQLiteCommand cmd = new SQLiteCommand(q.GetIp(Name), myconn); String Ip = Convert.ToString(cmd.ExecuteScalar()); SQLiteCommand cmd2 = new SQLiteCommand(q.GetUsername(Name), myconn); String Username = Convert.ToString(cmd.ExecuteScalar()); SQLiteCommand cmd1 = new SQLiteCommand(q.GetPassword(Name), myconn); String Password = Convert.ToString(cmd.ExecuteScalar()); if (ssh.TestConnection(Ip, Username, Password)) { return(1); } else { return(0); } } else { return(-1); //* if Name is not Existed (First Function) } }
public bool CheckConn0(String Name) { SSHConnection ssh = new SSHConnection(); SQLiteCommand cmd = new SQLiteCommand(q.GetIp(Name), myconn); String Ip = Convert.ToString(cmd.ExecuteScalar()); SQLiteCommand cmd2 = new SQLiteCommand(q.GetUsername(Name), myconn); String Username = Convert.ToString(cmd.ExecuteScalar()); SQLiteCommand cmd1 = new SQLiteCommand(q.GetPassword(Name), myconn); String Password = Convert.ToString(cmd.ExecuteScalar()); if (ssh.TestConnection(Ip, Username, Password)) { return(true); } else { return(false); } }