我尝试通过Java程序从本地(在我的系统中)打开HTML文件.我尝试了一些程序通过堆栈溢出,但它没有工作.
对于EG:我有这个小HTML文件.
<html>
<head>
Test Application
</head>
<body>
This is test application
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我的Java代码:
Runtime rTime = Runtime.getRuntime();
String url = "D:/hi.html";
String browser = "C:/Program Files/Internet Explorer/iexplore.exe ";
Process pc = rTime.exec(browser + url);
pc.waitFor();
Run Code Online (Sandbox Code Playgroud)
任何解决方案或提示赞赏.
java ×1