通过命令
我打开ftp
命令,如:
"C:\Users\`akuma142`>ftp 19.236.236.61
Connected to 19.236.236.61.
220 Microsoft FTP Service
User (19.236.236.61:(none)): akuma142
331 Password required for akuma142.
Password:
同样的事情我想尝试java包装类,但得到错误:
线程中的异常" main" java.io.IOExc在这里输入代码`eption:无法运行程序" c:\ Users \ akuma142 \ ftp 19.236.236.61":CreateProcess error = 2,系统找不到指定的文件 在java.lang.Proc
p public void execute() throws IOException
{
ProcessBuilder pb = new ProcessBuilder("c:\\Users\\akuma142\\\\ftp 19.236.236.61"," \\10.22.22.33. -u akuma142 -p Ashuasasas ping 10.40.34.56 ");
Process p = pb.start();"
答案 0 :(得分:0)
您可以尝试这种方式:
ProcessBuilder pb = new ProcessBuilder("C:\\Windows\\Notepad.exe", "D:\\MyDocument\\argument.txt");
Process p = pb.start();
或者
Runtime.getRuntime().exec("notepad D:\\MyDocument\\argument.txt");