我使用net send完成了以下 java 程序。它说消息发送成功,但我看不到消息。这是我的代码
import java.io.*;
import java.net.*;
class sample{
public static void main(String args[]) throws Exception
{
try{
Runtime r=Runtime.getRuntime();
Process p=null;
String msg;
String TRIP;
String cmd;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter ip address of remote host");
TRIP=br.readLine();
System.out.println("Enter the msg to be sent to remote host");
msg=br.readLine();
cmd="net send"+TRIP+""+msg;
p=r.exec(cmd);
Thread.sleep(1000);
System.out.println("msg soc sent to the sysytem");
}catch(Exception e){
System.out.println(e);
}
}
}