Тот же вопрос: How-to-update-the-gui-from-another-thread-in-c
Two Ways:
Пример:
public class data_holder_for_controls
{
//it will hold value for your label
public string status = string.Empty;
}
class Demo
{
public static data_holder_for_controls d1 = new data_holder_for_controls();
static void Main(string[] args)
{
ThreadStart ts = new ThreadStart(perform_logic);
Thread t1 = new Thread(ts);
t1.Start();
t1.Join();
//your_label.Text=d1.status; --- can access it from any thread
}
public static void perform_logic()
{
//put some code here in this function
for (int i = 0; i < 10; i++)
{
//statements here
}
//set result in status variable
d1.status = "Task done";
}
}
Почему бы не сделать свой собственный? Откройте ~/.bash_profile
или ~/.bashrc
или /etc/bashrc
(откройте его кнопкой sudo
) и добавьте следующую строку внизу:
alias tree='find . -print | sed -e "s;[^/]*/;|____;g;s;____|; |;g"'
Теперь выйдите из системы и снова войдите в систему, и ваш [ 115] команда должна работать - хотя без какой-либо функции утилиты, без сомнения:)
Я проверял это, но благодаря http://osxdaily.com/2016/09/09/view- папка-дерево-терминал-мак-ос-дерево-эквивалент / за идею.