求助读入 读写问题 在做ATM机的练习 不知道怎么把设置的账号和密码存入一个TXT文档里 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ATM 文件操作 在google上百度一下 f(sign.equals("Registe")){ if((file.length())==0){ String str=br.readLine(); String str1=br.readLine(); String str2=br.readLine(); String str3=br.readLine(); People p=new People(); p.setBankNo(str); p.setPwd(str1); p.setName(str2); p.setPeId(str3); ar.put(str,p); FileOutputStream fos = new FileOutputStream(file); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(ar); oos.close(); socket.close(); } String str = br.readLine(); String str1= br.readLine(); String str2=br.readLine(); String str3=br.readLine(); FileInputStream fis = new FileInputStream(file); ObjectInputStream ois = new ObjectInputStream(fis); HashMap<String,People> al =(HashMap<String,People>) ois.readObject(); People p=new People(); p.setBankNo(str); p.setPwd(str1); p.setName(str2); p.setPeId(str3); al.put(str,p); FileOutputStream fos = new FileOutputStream("Data.data"); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(al); oos.close(); ois.close(); StringBuffer sb=new StringBuffer(); Date da=new Date(); sb.append(str).append("用户注册的时间:").append((data.format(da)).toString()); pr.println(sb.toString()); fk.println("zhuce"); }就是这样子将密码和用户名写入到txt文件中的,流(thread)输入输出流。 在控制台中出现java.io.IOException: Stream closed这个是什么地方有问题 java socket通信问题 java的applet小程序 奇怪的问题,输入流对象自己消失了!? 我想把.java文件编译一下,然后输出到文本框中怎样才能实现啊 我的一个小小的计事本程序,对初学者有好处的,大侠看看给解释一下。。。 还得从新贴~~~都化了500分了 ie如何修复:Microsoft Internet Explorer 遇到问题需要关闭。我们对此引起的不便表示抱歉。 自定义类的一个问题 《Java核心编程》第一个小程序就过不去!求助 两道小题目! 新人求解,关于String类的问题 一个JAVA AWT的小问题,谢谢大侠们支持下
if((file.length())==0){ String str=br.readLine();
String str1=br.readLine();
String str2=br.readLine();
String str3=br.readLine();
People p=new People();
p.setBankNo(str);
p.setPwd(str1);
p.setName(str2);
p.setPeId(str3);
ar.put(str,p);
FileOutputStream fos = new FileOutputStream(file);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(ar);
oos.close();
socket.close();
}
String str = br.readLine();
String str1= br.readLine();
String str2=br.readLine();
String str3=br.readLine();
FileInputStream fis = new FileInputStream(file);
ObjectInputStream ois = new ObjectInputStream(fis);
HashMap<String,People> al =(HashMap<String,People>) ois.readObject();
People p=new People();
p.setBankNo(str);
p.setPwd(str1);
p.setName(str2);
p.setPeId(str3); al.put(str,p); FileOutputStream fos = new FileOutputStream("Data.data");
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(al);
oos.close();
ois.close();
StringBuffer sb=new StringBuffer();
Date da=new Date();
sb.append(str).append("用户注册的时间:").append((data.format(da)).toString());
pr.println(sb.toString()); fk.println("zhuce");
}
就是这样子将密码和用户名写入到txt文件中的,流(thread)输入输出流。
这个是什么地方有问题