Clipper On Line • Ver Tópico - Informações sobre a CPU, Processador, Rede, Bios, ETC...

Informações sobre a CPU, Processador, Rede, Bios, ETC...

Aqui você poderá oferecer suas Contribuições, Dicas e Tutoriais (Texto ou Vídeo) que sejam de interesse de todos.

Moderador: Moderadores

 

Informações sobre a CPU, Processador, Rede, Bios, ETC...

Mensagempor dbsh » 29 Jul 2017 12:42

Pegar informações sobre a CPU, Processador, Rede, Bios, ETC...

Util para criar serial, e obter informações sobre a Maquina.
Não são todas as informações disponíveis, é so pesquisar.

PROCEDURE WMI_Teste()

set alte to "wmi.log"
set alte on

WMI_LogicalDisk_Teste()
WMI_LogicalDiskToPartition_Teste()
WMI_DiskDrive_Teste()
WMI_DiskDriveToDiskPartition_Teste()
WMI_DiskPartition_Teste()
WMI_PhysicalMedia_Teste()
WMI_DiskDrivePhysicalMedia_Teste()
WMI_OperatingSystem_Teste()
WMI_NetworkAdapter_Teste()
WMI_NetworkAdapterConfiguration_Teste()
WMI_Processor_Teste()
WMI_ComputerSystemProduct_Teste()

set alte off
set alte to

RETURN

PROCEDURE WMI_TesteDisplay( sSelect, aSend, lInkey )
LOCAL aItem, xx, yy

DEFA lInkey TO .F.

aItem := WMI_Array( sSelect )

FOR xx := 1 TO Len(aItem)
   cls
   IF !lInkey
      ?
      ?
   ENDIF
   ?? sSelect, StrTrim(xx) + '/' + StrTrim(Len(aItem)), "Items: " + StrTrim(Len(aSend))
   ?
   FOR yy := 1 TO Len(aSend)
      IF lInkey .and. yy % 24 = 0
         Inkey(0, INKEY_KEYBOARD)
         cls
         ?? sSelect, StrTrim(xx) + '/' + StrTrim(Len(aItem)), "Items: " + StrTrim(Len(aSend))
         ?
      ENDIF
      ? StrTrim(yy), aSend[yy], "=", __objSendMsg( aItem[xx], aSend[yy] )
   NEXT
   IF lInkey .and. (yy -1 ) % 24 <> 0
      Inkey(0, INKEY_KEYBOARD)
   ENDIF
NEXT

RETURN

FUNCTION WMI_Object()
LOCAL oWMI, oErr

BEGIN SEQUENCE WITH {| e | Break( e ) }
   oWMI := CreateObject( "wbemScripting.SwbemLocator" ) // OleCria( "wbemScripting.SwbemLocator" )
RECOVER USING oErr
   oWMI := NIL
END

RETURN oWMI

FUNCTION WMI_Connect(oWMI)
LOCAL oSrv, oErr

BEGIN SEQUENCE WITH {| e | Break( e ) }
   DEFA oWMI TO WMI_Object()
   oSrv := oWMI:ConnectServer()
RECOVER USING oErr
   oSrv := NIL
END SEQUENCE

RETURN oSrv

FUNCTION WMI_Exec(sExec, oWmi, oSrv)
LOCAL oRet, oErr

BEGIN SEQUENCE WITH {| e | Break( e ) }
   DEFA oWMI TO WMI_Object()
   DEFA oSrv TO oWMI:ConnectServer()
   oRet := oSrv:ExecQuery( sExec )
RECOVER USING oErr
   oRet := NIL
END SEQUENCE

RETURN oRet

FUNCTION WMI_Array( sSelect, sWhere )
LOCAL aItem, oItem, oSelect

DEFA sWhere TO ""

aItem   := {}
oSelect := WMI_Exec("select * from " + sSelect + Trim(sWhere))

FOR EACH oItem in oSelect
   AAdd(aItem, oItem)
NEXT

RETURN aItem

PROCEDURE WMI_LogicalDisk_Teste()
LOCAL aSend

aSend := { ;
   "Access", "Availability", "BlockSize", "Caption", "Compressed", ;
   "ConfigManagerErrorCode", "ConfigManagerUserConfig",  "CreationClassName", "Description", "DeviceID", ;
   "DriveType", "ErrorCleared", "ErrorDescription", "ErrorMethodology", "FileSystem", ;
   "FreeSpace", "InstallDate", "LastErrorCode", "MaximumComponentLength", "MediaType", ;
   "Name", "NumberOfBlocks", "PNPDeviceID", "PowerManagementCapabilities", "PowerManagementSupported", ;
   "ProviderName", "Purpose", "QuotasDisabled", "QuotasIncomplete", "QuotasRebuilding", ;
   "Size", "Status", "StatusInfo", "SupportsDiskQuotas", "SupportsFileBasedCompression", ;
   "SystemCreationClassName", "SystemName", "VolumeDirty", "VolumeName", "VolumeSerialNumber" ;
   }

WMI_TesteDisplay( "Win32_LogicalDisk", aSend )

RETURN

PROCEDURE WMI_LogicalDiskToPartition_Teste()
LOCAL aSend

aSend := { "EndingAddress", "StartingAddress", "Antecedent", "Dependent" }

WMI_TesteDisplay( "Win32_LogicalDiskToPartition", aSend )

RETURN

PROCEDURE WMI_DiskDrive_Teste()
LOCAL aSend

aSend := { ;
   "Availability", "BytesPerSector", "Capabilities", "CapabilityDescriptions", "Caption", ;
   "CompressionMethod", "ConfigManagerErrorCode", "ConfigManagerUserConfig", "CreationClassName", "DefaultBlockSize", ;
   "Description", "DeviceID", "ErrorCleared", "ErrorDescription", "ErrorMethodology", ;
   "FirmwareRevision", "Index", "InstallDate", "InterfaceType", "LastErrorCode", ;
   "Manufacturer", "MaxBlockSize", "MaxMediaSize", "MediaLoaded", "MediaType", ;
   "MinBlockSize", "Model", "Name", "NeedsCleaning", "NumberOfMediaSupported", ;
   "Partitions", "PNPDeviceID", "PowerManagementCapabilities", "PowerManagementSupported", ;
   "SCSIBus", "SCSILogicalUnit", "SCSIPort", "SCSITargetId", "SectorsPerTrack", ;
   "SerialNumber", "Signature", "Size", "Status", "StatusInfo", ;
   "SystemCreationClassName", "SystemName", "TotalCylinders", "TotalHeads", "TotalSectors", ;
   "TotalTracks", "TracksPerCylinder" ;
   }

WMI_TesteDisplay( "Win32_DiskDrive", aSend )

RETURN

PROCEDURE WMI_DiskDriveToDiskPartition_Teste()
LOCAL aSend

aSend := { "Antecedent", "Dependent" }

WMI_TesteDisplay( "Win32_DiskDriveToDiskPartition", aSend )

RETURN

PROCEDURE WMI_DiskPartition_Teste()
LOCAL aSend

   //"AdditionalAvailability
   //"IdentifyingDescriptions
   //"MaxQuiesceTime
   //"OtherIdentifyingInfo
   //"PowerOnHours
   //"TotalPowerOnHours

aSend := { ;
   "Availability", "PowerManagementCapabilities", "StatusInfo", "Access", "BlockSize", ;
   "Bootable", "BootPartition", "Caption", "ConfigManagerErrorCode", "ConfigManagerUserConfig", ;
   "CreationClassName", "Description", "DeviceID", "DiskIndex", "ErrorCleared", ;
   "ErrorDescription", "ErrorMethodology", "HiddenSectors", "Index", "InstallDate", ;
   "LastErrorCode", "Name", "NumberOfBlocks", "PNPDeviceID", "PowerManagementSupported", ;
   "PrimaryPartition", "Purpose", "RewritePartition", "Size", "StartingOffset", ;
   "Status", "SystemCreationClassName", "SystemName", "Type" ;
   }

WMI_TesteDisplay( "Win32_DiskPartition", aSend )

RETURN

PROCEDURE WMI_PhysicalMedia_Teste()
LOCAL aSend

aSend := { ;
   "Caption", "Description", "InstallDate", "Name", "Status", ;
   "CreationClassName", "Manufacturer", "Model", "SKU", "SerialNumber", ;
   "Tag", "Version", "PartNumber", "OtherIdentifyingInfo", "PoweredOn", ;
   "Removable", "Replaceable", "HotSwappable", "Capacity", "MediaType", ;
   "MediaDescription", "WriteProtectOn", "CleanerMedia" ;
   }

WMI_TesteDisplay( "Win32_PhysicalMedia", aSend )

RETURN

PROCEDURE WMI_DiskDrivePhysicalMedia_Teste()
LOCAL aSend

aSend := { "Antecedent", "Dependent" }

WMI_TesteDisplay( "Win32_DiskDrivePhysicalMedia", aSend )

RETURN

PROCEDURE WMI_OperatingSystem_Teste()
LOCAL aSend

aSend := { "SerialNumber" }

WMI_TesteDisplay( "Win32_OperatingSystem", aSend )

RETURN

PROCEDURE WMI_NetworkAdapter_Teste()
LOCAL aSend

aSend := { ;
   "AdapterType", "AdapterTypeID", "AutoSense", "Availability", "Caption", ;
   "ConfigManagerErrorCode", "ConfigManagerUserConfig", "CreationClassName", "Description", "DeviceID", ;
   "ErrorCleared", "ErrorDescription", "GUID", "Index", "InstallDate", ;
   "Installed", "InterfaceIndex", "LastErrorCode", "MACAddress", "Manufacturer", ;
   "MaxNumberControlled", "MaxSpeed", "Name", "NetConnectionID", "NetConnectionStatus", ;
   "NetEnabled", "NetworkAddresses", "PermanentAddress", "PhysicalAdapter", "PNPDeviceID", ;
   "PowerManagementCapabilities", "PowerManagementSupported", "ProductName", "ServiceName", "Speed", ;
   "Status", "StatusInfo", "SystemCreationClassName", "SystemName", "TimeOfLastReset" ;
   }
WMI_TesteDisplay( "Win32_NetworkAdapter", aSend )

RETURN

PROCEDURE WMI_NetworkAdapterConfiguration_Teste()
LOCAL aSend

aSend := { ;
   "Caption", "Description", "SettingID", "ArpAlwaysSourceRoute", "ArpUseEtherSNAP", ;
   "DatabasePath", "DeadGWDetectEnabled", "DefaultIPGateway", "DefaultTOS", "DefaultTTL", ;
   "DHCPEnabled", "DHCPLeaseExpires", "DHCPLeaseObtained", "DHCPServer", "DNSDomain", ;
   "DNSDomainSuffixSearchOrder", "DNSEnabledForWINSResolution", "DNSHostName", "DNSServerSearchOrder", "DomainDNSRegistrationEnabled", ;
   "ForwardBufferMemory", "FullDNSRegistrationEnabled", "GatewayCostMetric", "IGMPLevel", "Index", ;
   "InterfaceIndex", "IPAddress", "IPConnectionMetric", "IPEnabled", "IPFilterSecurityEnabled", ;
   "IPPortSecurityEnabled", "IPSecPermitIPProtocols", "IPSecPermitTCPPorts", "IPSecPermitUDPPorts", "IPSubnet", ;
   "IPUseZeroBroadcast", "IPXAddress", "IPXEnabled", "IPXFrameType", "IPXMediaType", ;
   "IPXNetworkNumber", "IPXVirtualNetNumber", "KeepAliveInterval", "KeepAliveTime", "MACAddress", ;
   "MTU", "NumForwardPackets", "PMTUBHDetectEnabled", "PMTUDiscoveryEnabled", "ServiceName", ;
   "TcpipNetbiosOptions", "TcpMaxConnectRetransmissions", "TcpMaxDataRetransmissions", "TcpNumConnections", "TcpUseRFC1122UrgentPointer", ;
   "TcpWindowSize", "WINSEnableLMHostsLookup", "WINSHostLookupFile", "WINSPrimaryServer", "WINSScopeID", ;
   "WINSSecondaryServer" ;
   }

WMI_TesteDisplay( "Win32_NetworkAdapterConfiguration", aSend )

RETURN

PROCEDURE WMI_Processor_Teste()
LOCAL aSend

aSend := { ;
   "AddressWidth", "Architecture", "AssetTag", "Availability", "Caption", ;
   "Characteristics", "ConfigManagerErrorCode", "ConfigManagerUserConfig", "CpuStatus", "CreationClassName", ;
   "CurrentClockSpeed", "CurrentVoltage", "DataWidth", "Description", "DeviceID", ;
   "ErrorCleared", "ErrorDescription", "ExtClock", "Family", "InstallDate", ;
   "L2CacheSize", "L2CacheSpeed", "L3CacheSize", "L3CacheSpeed", "LastErrorCode", ;
   "Level", "LoadPercentage", "Manufacturer", "MaxClockSpeed", "Name", ;
   "NumberOfCores", "NumberOfEnabledCore", "NumberOfLogicalProcessors", "OtherFamilyDescription", "PartNumber", ;
   "PNPDeviceID", "PowerManagementCapabilities", "PowerManagementSupported", "ProcessorId", "ProcessorType", ;
   "Revision", "Role", "SecondLevelAddressTranslationExtensions", "SerialNumber", "SocketDesignation", ;
   "Status", "StatusInfo", "Stepping", "SystemCreationClassName", "SystemName", ;
   "ThreadCount", "UniqueId", "UpgradeMethod", "Version", "VirtualizationFirmwareEnabled", ;
   "VMMonitorModeExtensions", "VoltageCaps" ;
   }
WMI_TesteDisplay( "Win32_Processor", aSend )

RETURN

PROCEDURE WMI_ComputerSystemProduct_Teste()
LOCAL aSend

aSend := { ;
   "Caption", "Description", "IdentifyingNumber", "Name", "SKUNumber", ;
   "Vendor", "Version", "UUID" ;
   }
WMI_TesteDisplay( "Win32_ComputerSystemProduct", aSend )

RETURN

FUNCTION WMI_Service()
RETURN WMI_Array("Win32_Service")
010011110010000001110011011101010110001101100101011100110111001101101111001000001110100100100000011000110110111101101110011100110111010001110010011101011110110101100100011011110010000001100001001000000110111001101111011010010111010001100101
01001101011000010111001001100011011011110111001100100000010000010110111001110100011011110110111001101001011011110010000001000100011001010010000001000010011011110110111001101001
0101010001100101011011000011101000100000001010000011001000110111001010010011100100101101001110010011100000110100001100110010110100110101001100100011100100110000
Avatar de usuário

dbsh
Usuário Nível 3

Usuário Nível 3
 
Mensagens: 115
Data de registro: 14 Jul 2004 14:19
Cidade/Estado: ES
Curtiu: 2 vezes
Mens.Curtidas: 15 vezes



Retornar para Contribuições, Dicas e Tutoriais

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 1 visitante


Ola Amigo, espero que meu site e forum tem lhe beneficiado, com exemplos e dicas de programacao.
Entao divulgue o link da Doacao abaixo para seus amigos e redes sociais ou faça uma doacao para o site forum...
MUITO OBRIGADO PELA SUA DOACAO!
Faça uma doação para o forum
cron
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro