Visualizzazione dei risultati da 1 a 4 su 4

Discussione: DIr e java

  1. #1

    DIr e java

    Salve a tuttiiii!!!!
    il mio problemino è qst:
    devo cercare nel drive c: tutte le dir!!
    come posso fare???
    grzieee

  2. #2
    utilizza il metodo list della classe File:
    public String[] list()
    Returns an array of strings naming the files and directories in the directory denoted by this abstract pathname. If this abstract pathname does not denote a directory, then this method returns null. Otherwise an array of strings is returned, one for each file or directory in the directory.
    23-08-2005: Udinese in cémpions lìg
    Questa estate l'ho passata a Tallin

  3. #3
    Utente di HTML.it L'avatar di floyd
    Registrato dal
    Apr 2001
    Messaggi
    3,837
    File root = new File("C:\\");
    String[] dirs = root.list();
    for (int i=0; i<dirs.length; i++)
    if (new File(dirs[i].isDirectory())
    // qui il cod per la directory

  4. #4
    grazie millleeeee!!!
    Appena ho tempo lli provoo!!!

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 © 2024 vBulletin Solutions, Inc. All rights reserved.