基本信息
源码名称:Java 根据身份证号 查询户口所在地 例子
源码大小:0.03M
文件格式:.zip
开发语言:Java
更新时间:2015-08-11
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
package data; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.HashMap; import java.util.Map; /** * 从文件中获取相应的数据库 * @author OC */ public class Get { //获取输入 BufferedReader read; public Get() { try { //数据库地址 read=new BufferedReader(new FileReader(new File("d:\\data_txt\\add.txt"))); } catch (FileNotFoundException e) { e.printStackTrace(); } } /** * 此函数为获取地址的数据库 * @return */ Map<Integer,String> getMap_ProvincialCapital() { Map<Integer, String> map=new HashMap<>(); String date; String[] ap={"",""}; try { while(read.ready()) { //读取下一行 date=read.readLine(); //使用空格对字符串进行分割 ap=date.split("="); map.put(Integer.decode(ap[0]),ap[1]); } } catch (IOException e) { e.printStackTrace(); } //System.out.println(map.toString()); return map; } }