Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. /*
  2.  * Author: Marco 'RootkitNeo' C.
  3.  */
  4.  
  5. import java.util.Scanner;
  6.  
  7. class SoftwareExample
  8. {
  9.   public static void main(String[] args)
  10.   {
  11.     WindowsMemoryInformation wmi = new WindowsMemoryInformation();
  12.     JavaWindowsShell jws = new JavaWindowsShell();
  13.     WindowsHardwareInformation whi = new WindowsHardwareInformation();
  14.    
  15.     jws.cls();
  16.     System.out.println("Il seguente software offre un accesso diretto all'hardware mostrando\ninfo su Memoria e CPU.\n\n");
  17.    
  18.     Scanner input = new Scanner(System.in);
  19.     input.useDelimiter("\r\n");
  20.    
  21.     int choice = 0;
  22.     do {
  23.       System.out.println("###### Memory #######");
  24.       System.out.println("1. Memory Length\n"+
  25.                          "2. Memory Load\n"+
  26.                          "3. Total Physics\n"+
  27.                          "4. Avail Physics\n"+
  28.                          "5. Total Virtual\n"+
  29.                          "6. Avail Virtual\n\n"
  30.                         );
  31.       System.out.println("###### CPU ##########");
  32.       System.out.println("7. N. Processors\n"+
  33.                          "8. Architecture\n"+
  34.                          "9. Type\n\n"+
  35.                          "10. Esci\n\n"+
  36.                          "11. Clear Screen"
  37.                         );
  38.      
  39.      
  40.       try
  41.       {
  42.         choice = input.nextInt();
  43.       } catch(Exception e) {}
  44.      
  45.       switch(choice)
  46.       {
  47.         case 1:
  48.           System.out.println("Memory Length: "+wmi.length());
  49.           break;
  50.         case 2:
  51.           System.out.println("Memory Load: "+wmi.memoryLoad());
  52.           break;
  53.         case 3:
  54.           System.out.println("Total Physics: "+wmi.totalPhys());
  55.           break;
  56.         case 4:
  57.           System.out.println("Available Physics: "+wmi.availPhys());
  58.           break;
  59.         case 5:
  60.           System.out.println("Total Virtual: "+wmi.totalVirtual());
  61.           break;
  62.         case 6:
  63.           System.out.println("Available Virtual: "+wmi.availVirtual());
  64.           break;
  65.         case 7:
  66.           System.out.println("N. Processors: "+whi.numberOfProcessor());
  67.           break;
  68.         case 8:
  69.           System.out.println("Architecture: "+whi.processorArchitecture());
  70.           break;
  71.         case 9:
  72.           System.out.println("Type: "+whi.processorType());
  73.           break;
  74.         case 11:
  75.           jws.cls();
  76.       }
  77.      
  78.       System.out.println("Premi un tasto per continuare...");
  79.       input.next();
  80.       jws.cls();
  81.     } while(choice != 10);
  82.   }
  83. }