End Process C# Mono

Asked

Viewed 60 times

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?

  • 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.

  • It is not user permission or the _ instead of -? Checked if he is indeed being listed on Process.GetProcesses()?

  • is not being listed

  • Apparently with the tests done it is without permission as I assign the user permissions in the code

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.