如果你的电脑是64位系统,生成目标必须是64位,否则打不开osk.exe,至于原因,我目前也不清楚
代码:
private static Process kbpr = null;
/// <summary>
/// 显示软键盘
/// </summary>
public static void ShowInputPanel()
{
//如果kbpr为空,或者 kbpr已经终止程序
if (kbpr == null || kbpr.HasExited)
kbpr = System.Diagnostics.Process.Start("osk.exe");
Console.WriteLine("===========打开软键盘");
}
/// <summary>
/// 关闭软键盘
/// </summary>
public static void HideInputPanel()
{
if (kbpr != null && !kbpr.HasExited)
kbpr.Kill();
Console.WriteLine("===========关闭软键盘");
}
end