Java 打开磁盘文件

//如下打开的是C盘
String path="c:\"
Runtime runtime= Runtime.getRuntime(); Process process=null; path = "rundll32 url.dll FileProtocolHandler file://" + path; System.out.println("File:"+path); String cmd=path; try {   process=runtime.exec(cmd); } catch(Exception e){
  
}

  

posted @ 2020-09-26 18:58  墨白95  阅读(189)  评论(0编辑  收藏  举报