- Регистрация
- 26.08.2017
- Сообщения
- 2
- Благодарностей
- 0
- Баллы
- 1
Hello everyone. I have a simple C# code which checks for running processes, e.g. notepad.exe. I would like to include it in my project and parse the result to a variable. The code outputs a boolean. Here it is:
I've already added it to OwnCodeUsings, and I also included:
Here's a screenshot:
Now I'm kinda stuck with next step. I know that I need to call it from the Own C# as you can see here:
But unfortunately I have no idea what code to include so the result is passed to the variable entered below. I'm using this code to check whether cmd.exe process is running or not.
Thanks a lot for any help. Cheers!
Код:
public static class ProcessHelpers {
public static bool IsRunning (string name) => Process.GetProcessesByName(name).Length > 0;
}
I've already added it to OwnCodeUsings, and I also included:
Код:
using System.Diagnostics;
Here's a screenshot:
Now I'm kinda stuck with next step. I know that I need to call it from the Own C# as you can see here:
But unfortunately I have no idea what code to include so the result is passed to the variable entered below. I'm using this code to check whether cmd.exe process is running or not.
Thanks a lot for any help. Cheers!