Process.Start("telnet.exe") 抛出异常 [英] Process.Start("telnet.exe") throws exception
问题描述
我有两个在 W2k8 R2 x64 上运行的应用程序,一个编译为 64 位,另一个编译为 32 位,因为它具有 COM 依赖项.在两者中我都试图调用:
I have two applications running on W2k8 R2 x64, one is compiled as 64bit and the other one as 32bit as it has COM dependencies. In both I'm trying to call:
Process p = Process.Start("telnet.exe", string.Format("{0} {1}", address, port));
在 x64 中它工作得很好,但是在 32 位中我得到一个 System.ComponentModel.Win32Exception(系统找不到指定的文件")?
In the x64 it works perfectly fine, however in the 32bit one I get a System.ComponentModel.Win32Exception ("The system cannot find the file specified")?
知道这里发生了什么吗?即使我打电话
Any idea what's going on here? Even if I call
Process.Start(@"C:WindowsSystem32 elnet.exe")
我也遇到同样的异常?
谢谢,
汤姆
推荐答案
要从 32 位应用程序启动位于 system32 的 64 位应用程序(至少在 Vista、2k8、7 上,在 x64 XP 或 2k3 上不起作用)运行它从 sysnative 目录,即C:windowssysnative elnet.exe"(或者禁用 Wow64,但这通常是一个坏主意).
To launch a system32 located 64bit app from a 32bit app (at least on Vista,2k8,7, doesn't work on x64 XP or 2k3) run it from the sysnative directory, i.e. "C:windowssysnative elnet.exe" (alternatively disable Wow64 but that is generally a bad idea).
这篇关于Process.Start("telnet.exe") 抛出异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!