Selam,
Aşağıda yazdığım kodda sc1 command satırına gelince program ilerlemiyor olduğu gibi kalıyor. Hata nerededir ?
Ama sc1'i sildiğim zaman program düzgün çalışıyor.
if (txtSunucuismi.Text != "")
{
using (client = new SshClient("hostname1", 22, LDAP.username, LDAP.pass))
{
try
{
client.ConnectionInfo.Timeout = TimeSpan.FromSeconds(120);
client.Connect();
ss = client.CreateShellStream("msoffline",80,60,800,600,65536);
SshCommand sc1 = client.CreateCommand("ssh " + LDAP.username + "@hostname2");
listboxsonuc.Items.Add(sc1.CommandText);
sc1.Execute();
listboxsonuc.Items.Add(sc1.Result);
SshCommand sc2 = client.CreateCommand(LDAP.pass);
listboxsonuc.Items.Add(sc2.CommandText);
sc2.Execute();
listboxsonuc.Items.Add(sc2.Result);
SshCommand sc3 = client.CreateCommand("bash");
listboxsonuc.Items.Add(sc3.CommandText);
sc3.Execute();
listboxsonuc.Items.Add(sc3.Result);
SshCommand sc4 = client.CreateCommand("grep " + txtSunucuismi.Text + " /etc/hosts");
listboxsonuc.Items.Add(sc4.CommandText);
sc4.Execute();
listboxsonuc.Items.Add(sc4.Result);
client.Disconnect();
}
catch (Exception ex)
{
MessageBox.Show("Hata :"+ex.Message);
client.Disconnect();
}
}
}