好了,所以我想用下面的参数的Process.Start System.NullReferenceException:对象引用未设置到对象
启动过程当我尝试启动它,虽然我得到一个System.nullreferenceexception的实例:未将对象引用设置为对象的实例
我在做什么错?
Dim exepath As String = Application.StartupPath + "\bin\ffmpeg.exe"
Dim sr As StreamReader
Dim cmd As String = " -i """ + input + """ -ar 22050 -y """ + output + """"
Dim ffmpegOutput As String
proc.StartInfo.FileName = exepath
proc.StartInfo.Arguments = cmd
proc.StartInfo.UseShellExecute = False
proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
proc.StartInfo.RedirectStandardError = True 'redirect ffmpegs output
'to our application
proc.StartInfo.RedirectStandardOutput = True 'we don’t really need this
proc.StartInfo.CreateNoWindow = True
proc.Start()
正如您所示,代码无法抛出'NullReferenceException'。代码中的更多内容阻止了它的工作。 –