Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/12/2009, 10:40
taar
 
Fecha de Ingreso: diciembre-2001
Ubicación: Asuncion
Mensajes: 143
Antigüedad: 24 años, 10 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 File( System.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 = 0; index < drives.length; index++)
        {  
            
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