Application vb

rachidd1 Messages postés 8 Date d'inscription vendredi 26 décembre 2003 Statut Membre Dernière intervention 4 avril 2005 - 8 nov. 2004 à 17:14
cs_CanisLupus Messages postés 3757 Date d'inscription mardi 23 septembre 2003 Statut Membre Dernière intervention 13 mars 2006 - 8 nov. 2004 à 22:33
comment lire la configuration du system,comme la RAM,PROCESSEUR à partir du vb6?est ce que ces information sont stocker ds un fichier?qu'est est son chemain?

5 réponses

cboulas Messages postés 2641 Date d'inscription mercredi 2 juin 2004 Statut Membre Dernière intervention 8 janvier 2014 16
8 nov. 2004 à 17:26
Toutes ces informations sont stockés dans la base de registre.
Mais ce n'est que du texte qui est mis à jour lors d'une modification.

Voir à la clé :

HKEY_LOCAL_MACHINE/HARDWARE/...............

Ensuite les ............... c'est tout les dirs des paramètres.

Chris...
Web : Firstruner - eMail : [mailto:support@firstruner.com Support]
0
Tilois Messages postés 721 Date d'inscription dimanche 10 juin 2001 Statut Membre Dernière intervention 27 mars 2011 7
8 nov. 2004 à 18:03
WMI ..
0
crenaud76 Messages postés 4172 Date d'inscription mercredi 30 juillet 2003 Statut Membre Dernière intervention 9 juin 2006 28
8 nov. 2004 à 19:28
J'ai une source nommé WMI browser !!

Christophe R.
0
cs_CanisLupus Messages postés 3757 Date d'inscription mardi 23 septembre 2003 Statut Membre Dernière intervention 13 mars 2006 21
8 nov. 2004 à 20:48
Salut
Interroger la base de registre, c'est pas trop fiable à ce niveau.

Pour la taille RAM j'utilise ça :

' --------------------------------------------------------------------------------
' Fonction API retournant des informations sur la mémoire RAM
' --------------------------------------------------------------------------------
Declare Sub GlobalMemoryStatus _
  Lib "kernel32" _
    ( _
      lpBuffer As MEMORYSTATUS _
    )

Function Taille_RAM() As String
Dim Memoire As MEMORYSTATUS

  GlobalMemoryStatus Memoire
  
  If Memoire.dwTotalPhys > 1024 ^ 3 Then
    Taille_RAM = FormatNumber((Memoire.dwTotalPhys / 1024 ^ 3), -1) & " Go"
  Else
    If Memoire.dwTotalPhys > 1024 ^ 2 Then
      Taille_RAM = FormatNumber((Memoire.dwTotalPhys / 1024 ^ 2), -1) & " Mo"
    Else
      If Memoire.dwTotalPhys > 1024 Then
        Taille_RAM = FormatNumber((Memoire.dwTotalPhys / 1024), -1) & " Ko"
      End If
    End If
  End If
  
End Function


LA function taille_ram te retourne en string la taile de ta ram.

Je te fais un truc pour le processeur dans mon prochain post.

Cordialement, CanisLupus
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_CanisLupus Messages postés 3757 Date d'inscription mardi 23 septembre 2003 Statut Membre Dernière intervention 13 mars 2006 21
8 nov. 2004 à 22:33
Pour le processeur, par ex :

Dans une form :

Private Sub Form_Load()
Infos_Processeur
MsgBox Processeur_Type
MsgBox Processeur_Niveau
MsgBox Processeur_Revision
End Sub


Dans un module :
' Constantes pour GetSystemInfo
Private Const PROCESSOR_INTEL_386 As Long = 386
Private Const PROCESSOR_INTEL_486 As Long = 486
Private Const PROCESSOR_INTEL_PENTIUM As Long = 586
Private Const PROCESSOR_MIPS_R4000 As Long = 4000
Private Const PROCESSOR_ALPHA_21064 As Long = 21064

Private Const PROCESSOR_LEVEL_80386 As Long = 3
Private Const PROCESSOR_LEVEL_80486 As Long = 4
Private Const PROCESSOR_LEVEL_PENTIUM As Long = 5
Private Const PROCESSOR_LEVEL_PENTIUMII As Long = 6

Private Type SYSTEM_INFO
   dwOemID As Long
   dwPageSize As Long
   lpMinimumApplicationAddress As Long
   lpMaximumApplicationAddress As Long
   dwActiveProcessorMask As Long
   dwNumberOfProcessors As Long
   dwProcessorType As Long
   dwAllocationGranularity As Long
   wProcessorLevel As Integer
   wProcessorRevision As Integer
End Type

' --------------------------------------------------------------------------------
' Fonction API utilisées dans ce module
' --------------------------------------------------------------------------------
Private Declare Sub GetSystemInfo _
  Lib "kernel32" _
    ( _
      lpSystemInfo As SYSTEM_INFO _
    )

' Variables pour retourner les valeurs du processeur
Public Processeur_Type As String
Public Processeur_Niveau As String
Public Processeur_Revision As String

Sub Infos_Processeur()
Dim SI As SYSTEM_INFO
Dim tmp As String
  
  Call GetSystemInfo(SI)
  
  Select Case SI.dwProcessorType
     Case PROCESSOR_INTEL_386: tmp = "386"
     Case PROCESSOR_INTEL_486: tmp = "486"
     Case PROCESSOR_INTEL_PENTIUM: tmp = "Pentium"
     Case PROCESSOR_MIPS_R4000: tmp = "MIPS 4000"
     Case PROCESSOR_ALPHA_21064: tmp = "Alpha"
     Case Else: tmp = "inconnu"
  End Select
  
  Processeur_Type = SI.dwProcessorType & " : " & tmp
  
  Select Case SI.wProcessorLevel
     Case PROCESSOR_LEVEL_80386: tmp = "Intel 80386"
     Case PROCESSOR_LEVEL_80486: tmp = "Intel 80486"
     Case PROCESSOR_LEVEL_PENTIUM: tmp = "Intel Pentium"
     Case PROCESSOR_LEVEL_PENTIUMII: tmp = "Intel Pentium Pro, II, III or 4"
     Case Else: tmp = "inconnu"
  End Select
  
  Processeur_Niveau = SI.wProcessorLevel & " : " & tmp
  
  Processeur_Revision = SI.wProcessorRevision & " : " & _
        " Model " & " " & HiByte(SI.wProcessorRevision) & _
        ", Stepping " & LoByte(SI.wProcessorRevision)
        
End Sub

Function HiByte(ByVal wParam As Integer) As Byte
   
  'Récupération de l'octet fort
   HiByte = (wParam And &HFF00&) \ (&H100)

End Function

Function LoByte(ByVal wParam As Integer) As Byte

  ' Récupération de l'octet faible
   LoByte = wParam And &HFF&

End Function


Cordialement, CanisLupus
0
Rejoignez-nous