0
Good morning, I have a method that closes the application when I change the settings in windows, but in linux system it does not end the process follows below the code.
if (strProcesso.Trim() == "")
{
if (getSO() == enumPlataformaSO.Windows)
{
strProcesso = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
intQtdeProc = 1;
}
else
{
foreach (Process process in Process.GetProcessesByName("mono-sgen"))
{
process.Kill();
process.WaitForExit();
return false;
}
strProcesso = "mono-sgen";
intQtdeProc = 0;
}
}
how can I resolve this question?
It does not close or find the process by name?
– Leandro Angelo
it does not find the process to be finished as shown in the code, in windows works perfectly and the system is finished, but in linux it does nothing.
– Rainner
It is not user permission or the
_
instead of-
? Checked if he is indeed being listed onProcess.GetProcesses()
?– Leandro Angelo
is not being listed
– Rainner
Apparently with the tests done it is without permission as I assign the user permissions in the code
– Rainner