Visualizzazione dei risultati da 1 a 9 su 9

Visualizzazione discussione

  1. #2
    Utente di HTML.it
    Registrato dal
    May 2012
    Messaggi
    1,453
    Che gran pasticcio
    codice:
    public static void moveFile(String filePath, String dirPath) throws Exception {
        File file = new File(filePath);
        if(!file.renameTo(new File(dirPath + "\\" + file.getName())))
            throw new Exception("Cannot move file " + file.getAbsolutePath());
    }
    Da usare
    codice:
    try{
        moveFile("C:\\Dir\\Dir\\file.ext","C:\\Dir\\NewDir");
    }catch(Exception e){
        //...
    }
    Ultima modifica di RoTeam; 12-07-2015 a 00:13

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.