Java小功能(2)--根据文件路径打开文件所在目录

来源:互联网 发布:吃鸡手游 知乎 编辑:程序博客网 时间:2024/06/05 10:52
/** * 根据路径打开目录 *  * @exception/throws [违例类型] [违例说明] * @see [类、类#方法、类#成员] */public static void OpenDir(String pdfpath) {File file = new File(pdfpath);try {Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL " + "Explorer.exe /select," + file.getAbsolutePath());} catch (IOException e) {e.printStackTrace();}}

原创粉丝点击