摘要:
import java.lang.reflect.Field; static String url; public static void main(String[] agrs) throws Exception{ Class clazz = DBPool.class; Field fieldUrl = clazz.getDeclaredField("url"); fieldUrl.setAccessible(true);//只有这里设置为true才可以修改 fieldUrl.set(url, "192.168.10.155"); System.out. 阅读全文
摘要:
/** * 读取文本文件的配置信息 * @throws IOException * */ public static String readTxtFile() throws IOException{ String read; BufferedReader bufread= new BufferedReader(new FileReader(filename)); while((read=bufread.readLine())!=null){ readStr=(readStr+read); } System.out.println("读取配置文件信息:"+readStr); 阅读全文
摘要:
java相对路径http://www.blogjava.net/flysky19/articles/93492.html通过java.io读取text文本内容http://www.cnblogs.com/manongxiaojiang/archive/2012/10/13/2722068.html 阅读全文