ProcessStartInfo startInfo = new ProcessStartInfo("CMD.exe");
startInfo.Arguments = "/c " + URL;
Process p = new Process();
startInfo.RedirectStandardInput = true;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.CreateNoWindow = true;
p = Process.Start(startInfo);
string original = p.StandardOutput.ReadToEnd();
string result1 = Encoding.ASCII.GetString(Encoding.ASCII.GetBytes(original));
string result2 = Encoding.BigEndianUnicode.GetString(Encoding.BigEndianUnicode.GetBytes(original));
string result3 = Encoding.Unicode.GetString(Encoding.Unicode.GetBytes(original));
string result4 = Encoding.UTF32.GetString(Encoding.UTF32.GetBytes(original));
string result5 = Encoding.UTF7.GetString(Encoding.UTF7.GetBytes(original));
string result6 = Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(original));
cmd输出包含俄语字母,无法使用我尝试的所有编码正确解码。请帮忙。
我试过了:
startInfo.StandardOutputEncoding = Encoding."all possible encodings";
但没有帮助。
有任何想法吗?