C# 用c打开火车的窗户#
我的代码:C# 用c打开火车的窗户#,c#,sapi,C#,Sapi,我的代码: private void btnMicTrain_Click(object sender, RoutedEventArgs e) { ProcessStartInfo info = new ProcessStartInfo(); info.FileName = Environment.SystemDirectory+@"\Speech\SpeechUX\SpeechUXWiz.exe"; info.Arguments = "MicTraining"; info.
private void btnMicTrain_Click(object sender, RoutedEventArgs e)
{
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = Environment.SystemDirectory+@"\Speech\SpeechUX\SpeechUXWiz.exe";
info.Arguments = "MicTraining";
info.LoadUserProfile=true;
info.UseShellExecute=true;
info.WindowStyle=ProcessWindowStyle.Hidden;
Process.Start(info);
}
但我失败了
我尝试创建一个.dat文件并在我的应用程序中打开它,但也失败了
谢谢。这在我的系统上有效(顺便说一句,64位)
请注意,如果已经运行了现有代码,则可能需要确保关闭所有在后台运行的现有SpeechUXWiz.exe实例。将窗口显示为隐藏的代码确实启动了SpeechUXWiz.exe,但它是隐藏的。在关闭第一个实例之前,您无法启动另一个实例 我尝试了这段代码,但出现了一个异常“系统找不到指定的文件”。谢谢。您的计算机上存在SpeechUXWiz.exe吗?在目录“C:\Windows\System32\SpeechUX\SpeechUX”中,我跟踪到路径是正确的,我不知道为什么会出现异常。这与版本密切相关。请使用进行用户培训。谢谢您的否决票,Eric。作者没有说任何关于版本依赖性的内容,也许这对他来说并不重要。我看到有人在他的应用程序中打开了语音训练窗口。但我无法打开它。我如何在SAPI5.1和SAPI5.4中都做到这一点。非常感谢。
private void btnMicTrain_Click(object sender, RoutedEventArgs e)
{
ProcessStartInfo info = new ProcessStartInfo();
info.FileName = Environment.SystemDirectory+@"\Speech\SpeechUX\SpeechUXWiz.exe";
info.Arguments = "MicTraining";
Process.Start(info);
}