Package com.drighetto.wmicom4j.wmijtd

Examples of com.drighetto.wmicom4j.wmijtd.ISWbemLocator


  public static void main(String[] args) {
    ISWbemServices wbemServices = null;
    try {
      /* Connecting to WMI repository on current machine */
      System.out.print("=> Connecting to WMI repository on current machine...");
      ISWbemLocator wbemLocator = ClassFactory.createSWbemLocator();
      // Connect to current machine
      wbemServices = wbemLocator.connectServer("localhost", "Root\\CIMv2", "", "", "", "", 0, null);
      // Connect to remote machine
      // wbemServices = wbemLocator.connectServer("192.168.0.3",
      // "Root\\CIMv2", "Dominique", "Dominique", "", "", 0, null);
      System.out.println("Connected !");

View Full Code Here


    int iterationCount = 100000;
    //Perform several iteration
    for(int i = 0 ; i < iterationCount ; i++){
      System.out.printf("==> Iteration [%s / %s]\n",i,iterationCount);
      System.out.print("=> Connecting to WMI repository on current machine...");
      ISWbemLocator wbemLocator = ClassFactory.createSWbemLocator();
      /* Step 1 : Connect to current machine*/
      ISWbemServices wbemServices = wbemLocator.connectServer("localhost", "Root\\CIMv2", "", "", "", "", 0, null);
      System.out.println("Connected !");
      /*Perform a query*/
      // Select informations
      ISWbemObjectSet result = wbemServices.execQuery("Select * from Win32_USBDevice", "WQL", 16, null);
      // Display query results
View Full Code Here

TOP

Related Classes of com.drighetto.wmicom4j.wmijtd.ISWbemLocator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.