OVH Cloud OVH Cloud

Test de présence de Framework

4 réponses
Avatar
Fabrice
Bonjour,

Quel test peut-on réaliser pour vérifier la présence de Framework sur un PC,
et ce en VB6 ?

Base de registre ?
Fichier particulier ?

Merci de votre participation
Fabrice

4 réponses

Avatar
ng
Fabrice wrote:

Bonjour,

Quel test peut-on réaliser pour vérifier la présence de Framework sur un
PC, et ce en VB6 ?



Tout dépend du framework... Tu voir la précense de quel framework ?

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/
Avatar
Fabrice
Bonsoir,

Il sagit de : Microsoft .NET Framework 1.0

Merci de votre intéressement et de votre question
Fabrice

"ng" a écrit dans le message de news:

Fabrice wrote:

Bonjour,

Quel test peut-on réaliser pour vérifier la présence de Framework sur un
PC, et ce en VB6 ?



Tout dépend du framework... Tu voir la précense de quel framework ?

--
Nicolas G.
FAQ VB : http://faq.vb.free.fr
API Guide : http://www.allapi.net
Google Groups : http://groups.google.fr/
MZ-Tools : http://www.mztools.com/


Avatar
Clive
La réponse (grace à devx.com)

Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias
"RegOpenKeyExA" _
(ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As
Long, _
ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As
Long) As _
Long

Const KEY_READ = &H20019 ' ((READ_CONTROL Or KEY_QUERY_VALUE Or
' KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And
(Not
' SYNCHRONIZE))

' Return True if a Registry key exists

Function CheckRegistryKey(ByVal hKey As Long, ByVal KeyName As String)
As _
Boolean
Dim handle As Long
' Try to open the key
If RegOpenKeyEx(hKey, KeyName, 0, KEY_READ, handle) = 0 Then
' The key exists
CheckRegistryKey = True
' Close it before exiting
RegCloseKey handle
End If
End Function
' Return a Boolean value indicating whether the .NET Framework is
installed
' Note: this function require the CheckRegistryKey functions
Function IsDotNetFrameworkPresent() As Boolean
Const HKEY_LOCAL_MACHINE = &H80000002

IsDotNetFrameworkPresent = CheckRegistryKey(HKEY_LOCAL_MACHINE, _
"SoftwareMicrosoft.NETFramework")
End Function


Clive
Avatar
Fabrice
Bonsoir,

Merci à Clive, les tests seront réalisés demain
Mais aussi à tous les participants

Fabrice


"Clive" a écrit dans le message de news:

La réponse (grace à devx.com)

Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias
"RegOpenKeyExA" _
(ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As
Long, _
ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As
Long) As _
Long

Const KEY_READ = &H20019 ' ((READ_CONTROL Or KEY_QUERY_VALUE Or
' KEY_ENUMERATE_SUB_KEYS Or KEY_NOTIFY) And
(Not
' SYNCHRONIZE))

' Return True if a Registry key exists

Function CheckRegistryKey(ByVal hKey As Long, ByVal KeyName As String)
As _
Boolean
Dim handle As Long
' Try to open the key
If RegOpenKeyEx(hKey, KeyName, 0, KEY_READ, handle) = 0 Then
' The key exists
CheckRegistryKey = True
' Close it before exiting
RegCloseKey handle
End If
End Function
' Return a Boolean value indicating whether the .NET Framework is
installed
' Note: this function require the CheckRegistryKey functions
Function IsDotNetFrameworkPresent() As Boolean
Const HKEY_LOCAL_MACHINE = &H80000002

IsDotNetFrameworkPresent = CheckRegistryKey(HKEY_LOCAL_MACHINE, _
"SoftwareMicrosoft.NETFramework")
End Function


Clive