nilaoda / N_m3u8DL-CLI

[.NET] m3u8 downloader 开源的命令行m3u8/HLS/dash下载器,支持普通AES-128-CBC解密,多线程,自定义请求头等. 支持简体中文,繁体中文和英文. English Supported.
https://nilaoda.github.io/N_m3u8DL-CLI/
MIT License
14.17k stars 2.14k forks source link

使用java程序“Runtime.getRuntime().exec(cmd);”调用时出错 #195

Closed MineYuanlu closed 4 years ago

MineYuanlu commented 4 years ago

图片

MineYuanlu commented 4 years ago

未经处理的异常: System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.IO.IOException: 句柄无效。

在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) 在 System.Console.set_CursorVisible(Boolean value) 在 N_m3u8DL_CLI.NetCore.Program.Main(String[] args) --- 内部异常堆栈跟踪的结尾 --- 在 System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) 在 System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) 在 System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 在 Main(String[] )

nilaoda commented 4 years ago

有一段java的demo吗?我调试看看

MineYuanlu commented 4 years ago

我改了,原来就是直接在eclipse里面调用,我认为问题是这个下载器会修改控制台上的文字,而eclipse是不支持的。

MineYuanlu commented 4 years ago

/**

MineYuanlu commented 4 years ago

cmd.exe /C start /min "title" downloader.exe url 就可以正常运行了,这样会打开一个新的窗口

但是我推荐,添加一个参数:--noGui 关闭掉控制台输出