启动相关程序或显示“打开方式”另一个程序的对话框

编程入门 行业动态 更新时间:2024-10-09 13:22:27
本文介绍了启动相关程序或显示“打开方式”另一个程序的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在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:

这是正是我想要的。

更多推荐

启动相关程序或显示“打开方式”另一个程序的对话框

本文发布于:2023-11-13 06:17:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583671.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序   对话框   方式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!