回覆列表
  • 1 # 已經過期了

    public void createFile(){

    //path表示你所建立檔案的路徑

    String path = "d:/tr/rt";

    File f = new File(path);

    if(!f.exists()){

    f.mkdirs();

    }

    // fileName表示你建立的檔名;為txt型別;

    String fileName="test.txt";

    File file = new File(f,fileName);

    if(!file.exists()){

    try {

    file.createNewFile();

    } catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    }

    }

    //現在你可以在d:/tr/rt 目錄下找到test.txt檔案

  • 中秋節和大豐收的關聯?
  • 歌詞中有我在廣場等著你,廣場舞聽到的,不知道歌名是什麼?