winform程序打开cmd运行前设置编码格式,第一句设置代码就抛出异常,win10系统有的设备上是能正常设置,有的不行
System.Console.InputEncoding = System.Text.Encoding.GetEncoding("gb2312");
句柄无效。
在 System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
在 System.Console.set_InputEncoding(Encoding value)
在 AuthDelayFrm.CommonMethod.RunCmd(String cmd) 位置 E:\c#\RunWebApi\AuthDelayFrm\CommonMethod.cs:行号 93
在 AuthDelayFrm.CommonMethod.GetDriveDiskNumber() 位置 E:\c#\RunWebApi\AuthDelayFrm\CommonMethod.cs:行号 21