Answer the question
In order to leave comments, you need to log in
How to implement icon change after application launch?
Again, good evening everyone!
I wrote my first useful program thanks to the great help of one of the Qna.habr participants! But as they say, interest has spread, to add it for convenience.
Second question for today... :_(
I have code:
using (var client = new SshClient("0.0.0.0", "someName", "somePass"))
{
client.Connect();
string text = client.RunCommand("pgrep tor").Result;
if (text.Length == default)
{
client.RunCommand("systemctl start tor");
client.RunCommand("cp /etc/privoxy/toron/config /etc/privoxy/");
MessageBox.Show("Тор запущен.", "TOR status: ", MessageBoxButtons.OK);
}
else
{
client.RunCommand("systemctl stop tor");
client.RunCommand("cp /etc/privoxy/toroff/config /etc/privoxy/");
MessageBox.Show("Тор остановлен.", "TOR status: ", MessageBoxButtons.OK);
}
client.Disconnect();
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question