//java代码文件读取 try{ BufferedReader reader = new BufferedReader(new FileReader("C:\\Users\\joanna\\Desktop\\my.cnf")); String line = null; while ((line = reader.readLine()) != null){ System.out.println(line); } }catch(FileNotFoundException e){ e.printStackTrace(); }catch(IOException e){ e.printStackTrace(); } println("==========================================================") //println new File("C:\\Users\\joanna\\Desktop\\客户自备资料-地暖.txt").text new File("C:\\Users\\joanna\\Desktop\\my.cnf").eachLine { line -> println line //处理代码块 }
groovy 文件的读取
最新推荐文章于 2024-09-01 10:07:07 发布