【发布时间】:2015-07-03 18:40:06
【问题描述】:
我想重新启动我的 adsl 调制解调器,我的代码是这样的。代码运行良好,直到到达登录部分,我必须输入用户名(管理员)并按 enter 。问题是/c 不起作用(/c admin)。我怎么写管理员然后按回车?
public static void main(String[] args) throws IOException
{
String tel = "telnet 192.168.1.1 23";
String user = "admin";
String pass = "admin";
String reboot = "reboot";
String command = "cmd /c start cmd.exe /c"+tel;
Process child = Runtime.getRuntime().exec(command);
}
我登录部分的意思是这张图:
【问题讨论】: