Ciao a tutti,
vi chiedo qualche indicazione
su come ottenere i path della/e oracle home presenti sulla macchina,
utilizzando il registro di sistema.
In .NET qualcosa del tipo e' stato fatto con
Dim regKey As Microsoft.Win32.RegistryKey
' Registry key object
Dim regOracleHome As Microsoft.Win32.RegistryKey
' Current Oracle home key in registry
Dim strOracleHome As String
' The oracle home name
Dim strOracleHomeList() As String
' The list of oracle homes
Dim strOracleHomePath As String
' The path of the current oracle home
' Get all Oracle homes
regKey = Microsoft.Win32.Registry.LocalMachine
regKey = regKey.OpenSubKey("SOFTWARE\\Oracle\\All_Homes", False)
strOracleHomeList = regKey.GetSubKeyNames()
' Loop through list of Oracle homes and grab tnsnames.ora file from each one (if exists)
For Each strOracleHome In strOracleHomeList
regOracleHome = regKey.OpenSubKey(strOracleHome, False)
strOracleHomePath = CStr(regOracleHome.GetValue("PATH", vbNullString))
If File.Exists(strOracleHomePath & "\network\admin\tnsnames.ora") Then
mParseTNSFile(strOracleHomePath & "\network\admin\tnsnames.ora")
End If
Next
Come convertire il tutto in VB6 (mancano delle classi specifiche
in sostituzione di Microsoft.Win32.RegistryKey)?
Avete da darmi qualche buon pezzo di codice per sopperire alla mia mancanza mentale?
Ciao