java如何在html网页上打印linux服务器变量 1 周,4 日 Questions & Answers 48 基本上,我想创建一个网页来监视企业服务器的运行状况。 我需要的基本想法,我如何可以连接到服务器,并打印出一个企业服务器上使用putty IP的网页上的文件系统统计
# 1 楼答案 试试这个 Process p = Runtime.getRuntime().exec("my terminal command"); p.waitFor(); BufferedReader buf = new BufferedReader(new InputStreamReader( p.getInputStream())); String line = ""; String output = ""; while ((line = buf.readLine()) != null) { output += line + "\n"; } System.out.println(output);
# 1 楼答案
试试这个