本文介绍了启动相关程序或显示“打开方式”另一个程序的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Window Seven下,以下命令显示一个对话框,然后在没有任何其他操作的情况下终止,为什么?
Under Window Seven, the following command displays a dialog box then terminates without any other action, why?
预期效果是启动相关程序 Notepad ++ 或至少记事本
The expected effect is launching the associated program Notepad++ or at least Notepad
RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL D:\doc\toto.txt推荐答案
解决方案非常简单: cmde.exe start
这是嵌入命令的Java代码:
Here is the Java code which embed the command:
private void open( File file ) { try { final String cmd = String.format( "cmd.exe /C start %s", file.getAbsolutePath()); Runtime.getRuntime().exec( cmd ); } catch( final Throwable t ) { t.printStackTrace(); } }当 .project ,显示以下对话框:
当选择底部的单选按钮时,将显示以下对话框:
and when the radio button at the bottom is chosen the following dialog is shown:
这是正是我想要的。
更多推荐
启动相关程序或显示“打开方式”另一个程序的对话框
发布评论