日期:2014-05-20 浏览次数:20905 次
rootFile=this.getClass().getResource("").toString().substring(6);
控制台输出效果rootFile:E:/workspace/BroadcastControl/bin/zd/main/
InputStream is = this.getClass().getResourceAsStream(
"/lib/ttt.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String s = "";
try {
while ((s = br.readLine()) != null)
System.out.println(s);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}