自己处理文件内容,并写文件到硬盘
来源:互联网 发布:黄蓝带炒股软件 编辑:程序博客网 时间:2024/06/05 09:01
import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.File;import java.io.FileNotFoundException;import java.io.FileReader;import java.io.FileWriter;import java.io.IOException;public class WriteSelfContentFile2Disk {/** * 自己处理文件内容,并写文件到硬盘 * @param args */public static void main(String[] args) {writeSelfContent2Disk();}public static void writeSelfContent2Disk(){String lujing = "C:\\ss.txt";File file = new File(lujing);if (!file.getParentFile().exists()) {file.getParentFile().mkdirs();}try {file.createNewFile();} catch (IOException e) {e.printStackTrace();}try {FileWriter fw = new FileWriter(file, true);BufferedWriter bw = new BufferedWriter(fw);bw.write("kingid");bw.flush();bw.close();fw.close();} catch (IOException e) {e.printStackTrace();}try {FileReader fr = new FileReader(file);BufferedReader bReader = new BufferedReader(fr);String string = bReader.readLine();System.out.println(string);} catch (FileNotFoundException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}}}
0 0
- 自己处理文件内容,并写文件到硬盘
- JAVA读取超大文件内容并处理写到另外文件中
- 写字符串内容到文件
- 简单的读取文件内容并写到另一个指定的文件中
- Python 硬盘模式读取文件,保存内容到文件
- 将表中得内容写到文件中
- 把内容写到文件里
- 文件缓冲内容写到磁盘
- HttpClient获得内容写到文件
- Servlet练习--写内容到文件
- C# 创建文件并往文件里写内容
- 写数据到文件,并同步写到磁盘
- 如何处理BLOB类型数据之二:下载BLOB内容并保存到文件中
- Vista UAC 禁止程序员写文件到硬盘的解决方法
- 在控制台中写的内容写到文件中
- 读取文件内容并将内容添加到节点
- 把内容写入硬盘文件
- php 写内容到文件,把日志写到log文件
- Huawei E3372 for mint17 with usb_modeswith
- linux fcntl 函数
- mkdir()和mkdirs()
- 树莓派相关-树莓派串口配置方法
- C语言inline详细讲解
- 自己处理文件内容,并写文件到硬盘
- ToolBar沉浸式状态栏的兼容实现
- while函数输入小结
- "SetDestination" can only be called on an active agent that has been placed on a NavMesh.
- 项目报错
- sublime3 build3103版本 注册码 能用最新
- HDU 连续最大积
- 队列的链表实现
- 最长无重复字符子串练习题