给我发一份看看呗。代码最好写的清楚些。

解决方案 »

  1.   


    读写文本太费劲了 要不用数据库 要不用xml比你文本简单
      

  2.   

    import java.io.*;
    public class Test { /**

     * main(这里用一句话描述这个方法的作用)

     * TODO(这里描述这个方法适用条件 – 可选)

     * TODO(这里描述这个方法的执行流程 – 可选)

     * TODO(这里描述这个方法的使用方法 – 可选)

     * TODO(这里描述这个方法的注意事项 – 可选)

     * @param name

     * @param @return 设定文件

     * @return String DOM对象

     * @Exception 异常对象

     * @since CodingExample Ver(编码范例查看) 1.1

     */
    public static void main(String[] args) throws IOException{
    // TODO Auto-generated method stub
    BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    File file = new File("d:/test.txt");
    if(!file.exists()){

    file.createNewFile();
    }


    RandomAccessFile arf = new RandomAccessFile(file, "rw");
    System.out.println("Please input any text to edit it. 'Q' or 'q' to quit.");

    String str = "";
    long pos = file.length();
    arf.seek(pos);
    while( (str = reader.readLine()) != null && !str.equalsIgnoreCase("Q")){

    arf.write(str.getBytes());
    }

    arf.close();

    reader.close();
    }}
      

  3.   

    直接用apache的IO包就好了,方便快捷
      

  4.   

    直接用io流就可以了,建议楼主去看一下io流这一块,视频也好,书也好。不难。而且api里面提供的接口可以满足你基本的要求了。
      

  5.   

    这是我写的,参考参考希望对你有所帮助:http://lincoln911.download.csdn.net/user/lincoln911/记事本代码
      

  6.   

    我用流写过,是我刚学java时候做的j2se的小程序,增删改查全部实现了。