日期:2014-05-20 浏览次数:20577 次
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
public class Client {
public static void main(String[] args) throws Exception {
launch();
}
public static void launch() throws Exception {
boolean exit = false;
Map<String,User> reg = new HashMap<String,User>();
while(!exit) {
System.out.println("****欢迎进入奖客富翁系统*****");
System.out.println(" 1.注册");
System.out.println(" 2.登陆");
System.out.println(" 3.抽奖");
System.out.println("****************************");
System.out.print("请选择菜单:");
BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
String option = read.readLine();
option = option.replaceAll("
------解决方案--------------------
\t", "");
System.out.println();
if("1".equals(option)
------解决方案--------------------
"2".equals(option)
------解决方案--------------------
"3".equals(option)) {
if("1".equals(option)) {
register(reg);
} else if("2".equals(option)) {
login(reg);
} else {
lottery();
}
}
System.out.print("继续吗?(y/n):");
read = new BufferedReader(new InputStreamReader(System.in));
option = read.readLine();
option = option.replaceAll("
------解决方案--------------------
\t", "");
if("y".equals(option)) {
System.out.println();
System.out.println();
} else {
System.out.println("系统推出,谢谢使用!");
exit = true;
}
}
}
private static void register(Map<String,User> reg) throws Exception {
String username = "";
String password = "";
String cardno = "";
System.out.println("[奖客富翁系统 > 注册]");
System.out.println("请填写个人注册信息");
System.out.print("用户名:");
BufferedReader strin = new BufferedReader(new InputStreamReader(System.in));
username = strin.readLine();
username = username.replaceAll("
------解决方案--------------------