Re: Shelless SSH - WeOnlyDo Discussion board

Re: Shelless SSH (General questions)

by schenkp, Tuesday, July 07, 2009, 20:15 (5617 days ago) @ woddrazen

Peter,


Can you please try something like this:[code]
String hostname_value = ;

System.Collections.IDictionary envVars = Environment.GetEnvironmentVariables();
foreach (System.Collections.DictionaryEntry envVar in envVars)
{
if (envVar.Key.ToString() == ThinConnectedFrom )
{
hostname_value = envVar.Value.ToString();
}
}

MessageBox.Show(hostname_value);

WeOnlyDo.Client.SSH ssh1 = new WeOnlyDo.Client.SSH();
ssh1.Hostname = hostname_value;
...[/code]
Drazen

OK got it to work perfectly with this code

private void button1_Click(object sender, EventArgs e)
{

String hostname_value = ;
System.Collections.IDictionary envVars = Environment.GetEnvironmentVariables();
foreach (System.Collections.DictionaryEntry envVar in envVars)
{
if (envVar.Key.ToString() == ThinConnectedFrom )
{
hostname_value = envVar.Value.ToString();
}
}
WeOnlyDo.Client.SSH ssh1 = new WeOnlyDo.Client.SSH();
ssh1.Hostname = hostname_value;
ssh1.Protocol = WeOnlyDo.Client.SSH.SupportedProtocols.SSHAuto;
ssh1.Login = appliance ;
ssh1.Password = appliance ;
ssh1.Blocking = true;
ssh1.Command = killall -q vlc; export DISPLAY=:0.0; vlc --volume 512 rtsp://stfamtv0001/streama ;
ssh1.Connect();
}

Is there a way to add logging to it, something that is written to c: emp if the command was not working for some reason?


Complete thread: