V1.0
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
@@ -182,6 +183,16 @@ namespace DrillTools
|
||||
// 保存原始文件路径
|
||||
ViewModel.OriginalFilePath = files[0];
|
||||
|
||||
Encoding ansiEncoding;
|
||||
try
|
||||
{
|
||||
ansiEncoding = Encoding.GetEncoding(936); // 936是GB2312的代码页
|
||||
}
|
||||
catch
|
||||
{
|
||||
ansiEncoding = Encoding.Default; // 如果获取失败,使用系统默认编码
|
||||
}
|
||||
|
||||
var process = new Process
|
||||
{
|
||||
StartInfo = new ProcessStartInfo
|
||||
@@ -190,7 +201,8 @@ namespace DrillTools
|
||||
Arguments = $"/c type \"{files[0]}\"",
|
||||
RedirectStandardOutput = true,
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true
|
||||
CreateNoWindow = true,
|
||||
StandardOutputEncoding = ansiEncoding
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user