1、要在F盘下有一个叫test的条形图格式的文件,
Java代码
- package test;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileReader;
- public class ReaderFile {
- public static void main(String[] args) throws Exception {
- String fileName = "F://test.txt";
- File file = new File(fileName);
- if( !file.exists() ){
- System.out.println("file not exist");
- }
- FileReader fileReader = new FileReader(file);
- BufferedReader bReader = new BufferedReader(fileReader);
- String tempString = null;
- while ( (tempString = bReader.readLine()) != null ) {
- System.out.println(tempString);
- }
- bReader.close();
- fileReader.close();
- }
- }
package test; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; public class ReaderFile { public static void main(String[] args) throws Exception { String fileName = "F://test.txt"; File file = new File(fileName); if( !file.exists() ){ System.out.println("file not exist"); } FileReader fileReader = new FileReader(file); BufferedReader bReader = new BufferedReader(fileReader); String tempString = null; while ( (tempString = bReader.readLine()) != null ) { System.out.println(tempString); } bReader.close(); fileReader.close(); } }
java企业级通用权限安全框架源码 SpringMVC mybatis or hibernate+ehcache shiro druid bootstrap HTML5
时间: 2024-10-14 15:37:05