-1
I’m making a program, in it I have to stop the execution of a screen with a condition. I found a way to do it here on the Internet, but I don’t want to just copy, I want to understand!
Follows the code:
public void PararExecucaoERetornarAoMenu()
{
var menu = new TelaMenu(repositorioPessoa);
menu.Executar();
Process.GetCurrentProcess().Kill();
}
What is it for? In what situations use? There are other functions that do the same thing as him?
I understood, so for my case it is not usual, because it kills the entire program and not only the execution of a class where it was put. How could I do this without killing the entire program process? I will use my example: I have the class Telacadatro and in it I have fields(name, sex, age, nationality), I want the
– Nathan
I’m not sure but Voce can try using the
Close();
example in doc: https://docs.microsoft.com/pt-br/dotnet/api/system.diagnostics.process.close?view=netframework-4.8– Jacson - ANLS
I also saw something similar in https://stackoverflow.com/questions/3077961/how-to-delete--instance-of-a-class
– Jacson - ANLS