Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/12/2009, 10:40
taar
 
Fecha de Ingreso: diciembre-2001
Ubicación: Asuncion
Mensajes: 143
Antigüedad: 23 años, 3 meses
Puntos: 1
Respuesta: comando para sacar los datos de la pc

Código PHP:
import java.util.*;
import java.io.File;

public class 
Prueba
{
    public static 
void main (String[] args)
    {
        
System.out.println"SO: " System.getProperty("os.name") );
        
System.out.println"Version: " System.getProperty("os.version") );
        
System.out.println"Arquitectura: " System.getProperty("os.arch") );
        
System.out.println"Usuario: " System.getProperty("user.name") );
        
System.out.println"Directorio del Usuario: " System.getProperty("user.home") );
        
        
System.out.println("ESPACIO EN EL DISCO");
        
File file = new FileSystem.getProperty("user.dir") ); 
        
Long total file.getTotalSpace();
        
Long libre file.getFreeSpace();
        
Long usado total libre;
        
System.out.println"Total: " total );
        
System.out.println"Libre: " libre );
        
System.out.println"Usado: " usado );
        
        
System.out.println("UNIDADES DE DISCOS");
        
File drives[] = File.listRoots(); 
        for (
int index 0index drives.lengthindex++)
        {  
            
System.out.println(drives[index]);  
        }
        
// Las unidades de discos solo es para Windows, en Linux devolveria "/"
    
}

Tambien puedes investigar el paquete Package java.lang.management para obtener información de la memoria