Re: Shelless SSH - WeOnlyDo Discussion board

Re: Shelless SSH (General questions)

by schenkp, Tuesday, July 07, 2009, 18:23 (5617 days ago) @ woddrazen

Peter,


Here is example how to read environment variable and environment variable values in C#
[code]System.Collections.IDictionary envVars = Environment.GetEnvironmentVariables();
foreach (System.Collections.DictionaryEntry envVar in envVars)
{
Console.WriteLine(envVar.Key + = + envVar.Value);
}[/code]Can you try that and let us know how it goes?


Drazen

Not exactly sure how to get this to work.

I’m not familiar enough with c# coding to pass along the correct variable to make this happen. Here is what I have so far

WeOnlyDo.Client.SSH ssh1 = new WeOnlyDo.Client.SSH();

System.Collections.IDictionary envVars = Environment.GetEnvironmentVariables();

private void button1_Click(object sender, EventArgs e)
{

foreach (System.Collections.DictionaryEntry envVar in envVars)
{
Console.WriteLine(envVar.Key + = + envVar.Value);
}

ssh1.Hostname = ThinConnectedFrom ;
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();
}

Any help would be greatly apprecieated.


Complete thread: