There is a way to terminate a project if it runing for a longer time?

  • Автор темы Автор темы EtaLasquera
  • Дата начала Дата начала

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
527
Реакции
113
Баллы
43
As the tread say, there is a way to write in any point of project, as a snipet, c# common code, etc a way to terminate project if it is running for a long time, as example, if project is running for 30 min, terminate it.
 
Stop thread.png
 
Thanks!

I'll test for tasks sheduled in task manager.... that tasks the "interrupt" command not work (in older versions).
 
Последнее редактирование:
Why not work? you should set execution timeout and if thread hanges longer than this time, it will closed
Sorry, I add older versions because If my task crash for any reasons after enter in eternal waiting for website answer, If I try enter in task manager, right click on stoped task and click in "interrupt", the command never works, the same problem not occours in tasks sheduled by sheduled taks outside task manager.
 
Is There any C# code to stop the project at a certain time? For example stop project after 10 PM
 
Yes.
Код:
Развернуть Свернуть Копировать
if (DateTime.Now.Hour > 22){
    ZennoPoster.StopTask("Mytask");
}
 
Here is the best solution...
 

Вложения

  • mem.xmlz
    mem.xmlz
    23 KB · Просмотры: 254

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)