zl程序教程

您现在的位置是:首页 >  其它

当前栏目

Netbeans rcp中获得本地文件系统路径

路径 本地 获得 文件系统 Netbeans
2023-09-27 14:22:24 时间

通过file协议

——————————————————————————————————————————————————————

            URL url = new URL("file:///E:/AutoTest.exe");
            File file1 = Utilities.toFile(url.toURI());
            System.out.println(file1.getAbsolutePath());
            final Process process = Runtime.getRuntime().exec(file1.getAbsolutePath());
            int exitCode = process.waitFor();
            if(exitCode == 0) {
                // 读取结论
                
            }