📄 uppercaseclient.java
字号:
package td1;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
public class UpperCaseClient {
public static void main(String[] args) {
if (args.length < 3) {
System.out.println(
"Usage : UpperCaseClient <adresse IP> <nom_du_serveur> <chaine_a_mettre_en_majuscule>");
System.exit(1);
}
try {
UpperCase server =
(UpperCase) Naming.lookup("rmi://" + args[0] + "/" + args[1]);
System.out.println(server.toUpperCase(args[2]));
} catch (MalformedURLException e) {
System.out.println("Bad URL");
e.printStackTrace();
} catch (RemoteException e) {
System.out.println("NetworkProblem");
e.printStackTrace();
} catch (NotBoundException e) {
System.out.println("Server not found");
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -