VB.Net 如何列舉電腦中所安裝的 ODBC Driver

VB.Net 如何列舉電腦中所安裝的 ODBC Driver

VB.Net 如何列舉電腦中所安裝的 ODBC Driver

' 由登錄檔讀取電腦中所安裝的 ODBC 驅動程式

Imports Microsoft.Win32

Public Class Form1

Private Sub Button1_Click(ByVal s As Object, ByVal e As EventArgs) Handles Button1.Click

Dim RegKey As RegistryKey = _

Registry.LocalMachine.OpenSubKey("Software\ODBC\ODBCINST.INI")

ListBox1.Items.Clear()

For Each drv As String In RegKey.GetSubKeyNames

ListBox1.Items.Add(drv)

Next

End Sub

End Class

列舉電腦中所安裝的 ODBC Driver