Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: How to send results of client.RunCommand to a listbox WinForms C#

$
0
0
Outputting the results of ls -la or iostat to the listbox is okay, columns are a bit off, more formatting required.

This is okay for these commands, top for example doesn't display.
var output = client.RunCommand(command);
                string[] lines = Regex.Split(output.Result, "\n");

                //String[] lines = output.Result.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);

                foreach (string line in lines)
                {
                    listBox1.Items.Add(line);
                    this.Invoke(new Action(() => listBox1.TopIndex = listBox1.Items.Count - 1));
                }

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>