Pergunta

I have started the VLC player in my application using this code:

Process.Start("C://Program Files//Videolan//VLC//VLC.exe", "\"rtsp://xxx.xxx.xx.xx:554/h264\" --qt-start-minimized --sout=#transcode{vcodec=theo,vb=800,acodec=flac,ab=128,channels=2,samplerate=44100}:file{dst=C:\\123.ogg,no-overwrite}");

Now I need to stop/close this. Please advice.

Foi útil?

Solução

Process.Kill(); should do the trick.

A somewhat gentler way would be Process.CloseMainWindow, but depends on implementation.

Reference: Process.Kill Method (MSDN).

Outras dicas

You can kill by using the following code

try
{   
    foreach (Process proc in Process.GetProcessesByName("processname"))
    {
        proc.Kill();
    }
}
catch(Exception ex)
{

}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top