你的当前目录下有"word.txt" 吗?没有,当然会报错,win98下可能正好有这么个文件。

解决方案 »

  1.   

    这样试试。String  m_strPath = "";
    File  m_fConfRecordPath = null;
    m_strPath=System.getProperty("user.dir");
    m_fConfRecordPath=new File(m_strPath);
    if(!m_fConfRecordPath.exists())
    {
      m_fConfRecordPath.mkdir();
    }
    File m_fFileRecord=new File(m_fConfRecordPath,"word.txt");
    System.out.println("新建文件成功");
    // BufferedReader file=new BufferedReader(new FileReader(m_fFileRecord));try
    {
      String  strValueTemp = "";
      FileOutputStream fos = new FileOutputStream(m_fFileRecord);
      DataOutputStream dout = new DataOutputStream(fos);
      dout.writeUTF("中国");
      fos.close();
    }
    catch(FileNotFoundException e)
    {
      ;
    }
    catch(IOException ee)
    {
     ;
    }