Relative Content

Tag Archive for c#.netprocesskillunsubscribe

.NET Process.OutputDataReceived still receiving data afte unsubscribe the Event Handler and Kill the Process

Please. I need to read data from a process asynchronously because sometimes data is received indefinitely and cannot be read synchronously. When I have read enough characters, I unsubscribe from the event handlers and kill the process, returnig the value However, the data is still received in OutputDataReceived and ErrorDataReceived, even when the program has already exited the GetYTTitle() function. How can I stop receiving this data in the event handlers?
Here is the function sample: