none
Como faço isto???? RRS feed

  • Pergunta

  • Amigos do fórum,

    Preciso de uma ajuda com uma coisa que desejo fazer.

    Por exemplo Eu tenho este script aqui:

      aLin = sWin("3", "Processador")
     aLin = aLin & dLine0("divup1", nCPU & " Processador(es)")

     iCPU = 0
     strProp = "*" '"Name, Family, CurrentClockSpeed, MaxClockSpeed, NumberOfCores, NumberOfLogicalProcessors, LoadPercentage, ProcessorId, Availability, AddressWidth, Version, Revision, Stepping, PowerManagementSupported, CurrentVoltage, SocketDesignation, ExtClock, L2CacheSize, L2CacheSpeed, Manufacturer, Description"
     objClass = "Win32_Processor"
     strQuery = "SELECT " & strProp & " FROM " & objClass
     Set ColItems = objWMI.ExecQuery(strQuery, "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
     For Each objItem in ColItems
      iCPU = iCPU + 1
      CPUName = objItem.Name
      CPUFam = gCPUFam(objItem.Family)
      CPUCurClock = fClock(objItem.CurrentClockSpeed) & " (" & objItem.CurrentClockSpeed & " MHz)"
      CPUMaxClock = fClock(objItem.MaxClockSpeed) & " (" & objItem.MaxClockSpeed & " MHz)"
      CPUnCore = objItem.NumberOfCores
      CPUnLogic = objItem.NumberOfLogicalProcessors
      CPULPerc = fPerc(objItem.LoadPercentage)
      CPUID = objItem.ProcessorId
      CPUAddress = fBit(objItem.AddressWidth)
      CPUAval = fCPUAval(objItem.Availability)
      CPUVer = objItem.Version
      CPURev = objItem.Revision
      CPUStep = objItem.Stepping
      CPUPMan = fCPUMan(objItem.PowerManagementSupported)
      CPUVolt = fCPUVolt(objItem.CurrentVoltage)
      CPUSocket = objItem.SocketDesignation

      strProp = "*"
      objClass = "Win32_CacheMemory"
      strQuery = "SELECT " & strProp & " FROM " & objClass
      Set ColItems = objWMI.ExecQuery(strQuery, "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)
      For Each objItem1 in ColItems
       iCache = iCache + 1
       CPUCachePur = objItem1.Purpose
       CPUCache = objItem1.MaxCacheSize
       'CPUCache2 = objItem1.MaxCacheSize
       'WScript.Echo CPUCachePur
       'WScript.Echo CPUCache1
       'WScript.Echo CPUCache2

       'If CPUCachePur = "L1 Cache" Then
       ' CPUCache1 = objItem1.MaxCacheSize
       'If
       ' Case "L2 Cache": CPUCache2 = objItem1.MaxCacheSize
       'End Select
      Next
      aLin = aLin & dLine0("divup2", "Processador nº " & iCPU & "/" & nCPU)
      aLin = aLin & aLine0("", fColor, "67", "Processador:", "225", CPUName, "79", "Família da CPU:", "212", CPUFam)
      aLin = aLin & aLine0("", fColor, "97", "Freq. Atual da CPU:", "195", CPUCurClock, "99", "Freq. Orig. da CPU:", "192", CPUMaxClock)
      aLin = aLin & aLine0("", fColor, "66", "Nº de Cores:", "226", CPUnCore, "107", "Nº de Proc. Lógicos:", "184", CPUnLogic)
      aLin = aLin & aLine0("", fColor, "62", "Uso da CPU:", "230", CPULPerc, "56", "Id. da CPU:", "235", CPUID)
      aLin = aLin & aLine0("", fColor, "75", "Ender. da CPU:", "217", CPUAddress, "75", "Status da CPU:", "216", CPUAval)
      aLin = aLin & aLine0("", fColor, "40", "Versão:", "252", CPUVer, "40", "Revisão:", "251", CPURev)
      aLin = aLin & aLine0("", fColor, "46", "Stepping:", "246", CPUStep, "102", "Power Management:", "189", CPUPMan)
      aLin = aLin & aLine0("", fColor, "88", "Voltagem da CPU:", "204", CPUVolt, "40", "Socket:", "251", CPUSocket)
      'aLin = aLin & aLine0("", fColor, "50", "Cache L1:", "242", CPUCache, "50", "Cache L2:", "241", CPUCache)
      aLin = aLin & dLine0("linestyle2", "  ")

     

      Na propriedade MaxCacheSize da classe "Win32_CacheMemory" preciso recuperar os valores para os caches L1 e L2, até aí OK, mas como fazer para acomodar estes valores em variáveis diferentes para que Eu possa colocálos em uma mesma linha como esta aqui:

    aLin = aLin & aLine0("", fColor, "50", "Cache L1:", "242", CPUCache, "50", "Cache L2:", "241", CPUCache)

    Alguma idéia???

    sexta-feira, 19 de janeiro de 2007 17:23

Todas as Respostas