M
M
Midzakikayo2020-08-15 19:11:23
C++ / C#
Midzakikayo, 2020-08-15 19:11:23

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();
                
            }


I would like to implement a change of icon every time the program is executed, to indicate the status.
What method to use and where can I read about it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question