How do I send ctrl+c to a process in c#?
Despite the fact that using GenerateConsoleCtrlEvent() for sending Ctrl+C signal is the right answer, it needs significant clarification to get it to work in different .NET application types. If your .NET application doesn’t use its own console (Windows Forms/WPF/Windows Service/ASP.NET), the basic flow is: Attach the main .NET process to the console of the process … Read more