?? testinterfaceremoteimpl.java
字號:
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.io.*;
/**
* 接口的實現
* @author jiangzhen
*
*/
public class TestInterfaceRemoteImpl extends UnicastRemoteObject implements
TestInterfactRemote {
public TestInterfaceRemoteImpl() throws RemoteException {
super();
}
public String add(String a, String b) throws RemoteException {
return a+b+" in Server";
}
public String add() throws RemoteException {
return "Hello Word";
}
public String executeDOS(String q) throws IOException{
String command = q;
Runtime r= Runtime.getRuntime();
Process p= r.exec(command);
BufferedReader br= new BufferedReader(new InputStreamReader(p.getInputStream() ));
StringBuffer sb= new StringBuffer();
String inline="";
while(null!= (inline=br.readLine())){
sb.append(inline).append("\n");
}
return sb.toString();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -