带控制台
string strCmdText = "/C ffplay \"D:\\dynamic wallpaper\\2.mp4\"";
System.Diagnostics.Process.Start("cmd.exe", strCmdText);
string strCmdText = "\"D:\\dynamic wallpaper\\2.mp4\"";
System.Diagnostics.Process.Start(@"D:\my-tools\ffmpeg-4.3.1-win32\static\bin\ffplay.exe", strCmdText);
隐藏控制台
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "/C ffplay \"D:\\dynamic wallpaper\\2.mp4\"";
process.StartInfo = startInfo;
process.Start();
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = @"D:\my-tools\ffmpeg-4.3.1-win32\static\bin\ffplay.exe";
startInfo.Arguments = "\"D:\\dynamic wallpaper\\2.mp4\"";
process.StartInfo = startInfo;
process.Start();