uppercaseclient.java

来自「this java program」· Java 代码 · 共 33 行

JAVA
33
字号
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 + =
减小字号Ctrl + -
显示快捷键?