public static bool ConnectSSH(string ipaddress, int portaddress, List <SSH> lssh, int sshline, Label lbl) { Form1 frm = new Form1(); sshLine = sshline; ConnectSSH: ThuVienDll.BvSshIOS.closebitvise(portaddress); sshNet sshnet = new sshNet(iStatic.ipIphone); SSH sshproxy = nextSSH(lssh); if (sshproxy == null) { iStatic.setStatus("SSH Het", lbl); return(false); } iStatic.setStatus("Kết Nối SSH : " + sshproxy.IP + "|" + sshproxy.username + "|" + sshproxy.password, lbl); ThuVienDll.FuncFolder tvfile = new ThuVienDll.FuncFolder(); if (!ThuVienDll.BvSshIOS.SetSSH(sshproxy.IP, sshproxy.username, sshproxy.password, ipaddress, portaddress.ToString(), 15)) { ThuVienDll.BvSshIOS.closebitvise(portaddress); Console.WriteLine(sshline); lssh[sshLine].live = "dead"; goto ConnectSSH; } lssh[sshLine].live = "live"; SaveSSH(lssh); iStatic.setStatus("Kết Nối SSH Thành Công ", lbl); return(true); }
private void button1_Click(object sender, EventArgs e) { comboBox1.Items.Clear(); sshNet sshnet = new sshNet(iStatic.ipIphone); sshnet.OpenApp(iStatic.nameApp9); Thread.Sleep(1000); comboBox1.Enabled = false; string text = string.Empty; ThuVienDll.FuncFolder file = new ThuVienDll.FuncFolder(); foreach (string str in sshnet.GetAppList()) { string[] arrnameapp = str.Split('='); if (arrnameapp.Length - 1 > 0) { text += arrnameapp[1] + "|"; comboBox1.Items.Add(arrnameapp[1].Trim()); } } File.WriteAllText(iStatic.diraidIphone + "/Applist.txt", text); comboBox1.Enabled = true; }