Téléchargé 1 fois
Vote des utilisateurs


Détails
Licence : Non renseignée
Mise en ligne le 10 mars 2011
Langue : Français
Référencé dans
Navigation
JNI : Récuperer le types des disques (Delphi)
JNI : Récuperer le types des disques (Delphi)
Cet exemple met en évidence l'utilisation de JNI (Java Native Interface) en combinaison avec du code Delphi.
Exemple d'utilisation :
String drive = "c:\\";
int type = DriveInfo.getDriveType(drive);
switch(type){
case DriveInfo.FIXED :
System.out.println("c:\\ est un disque dur");
break;
default:break;
}
boolean amovible = DriveInfo.isRemovable(drive);
System.out.println("c:\\ amovible : "+amovible);
File[] roots = File.listRoots();
for(int i = 0; i < roots.length; i++){
File root = roots[i];
String name = root.getPath();
System.out.println(name+" : "+DriveInfo.getDriveInfo(name));
}
Exemple d'utilisation :
String drive = "c:\\";
int type = DriveInfo.getDriveType(drive);
switch(type){
case DriveInfo.FIXED :
System.out.println("c:\\ est un disque dur");
break;
default:break;
}
boolean amovible = DriveInfo.isRemovable(drive);
System.out.println("c:\\ amovible : "+amovible);
File[] roots = File.listRoots();
for(int i = 0; i < roots.length; i++){
File root = roots[i];
String name = root.getPath();
System.out.println(name+" : "+DriveInfo.getDriveInfo(name));
}
Developpez.com décline toute responsabilité quant à l'utilisation des différents éléments téléchargés.