读书人

需要VB.NET(VB2005) 的关于注册表读写

发布时间: 2012-01-05 22:36:54 作者: rapoo

需要VB.NET(VB2005) 的关于注册表读写例子的源代码(能在WINCE中使用更好)。
需要VB.NET(VB2005) 的关于注册表读写例子的源代码(能在WINCE中使用更好)。
请高手们,有类似代码,贴点上来,本人刚从VB6升级过来,对注册表操作不太熟悉。
目前要做一个在WINCE注册表中找出可用串口的程序要用。

[解决办法]

VB.NET code
        '****************************************************        '判断注册表中是否已经选择中扫描终端类型过,如果选择正确,则下次可以不用选择。        '****************************************************        Dim sRegScanType As String        Dim hklm As RegistryKey = Registry.LocalMachine        Dim subkey As RegistryKey        subkey = hklm.OpenSubKey("STScan", False)        If subkey Is Nothing Then            sRegScanType = ""        Else            sRegScanType = subkey.GetValue("Type").ToString        End If        If Not subkey Is Nothing Then            subkey.Close()            subkey = Nothing        End If        If Not hklm Is Nothing Then            hklm.Close()            hklm = Nothing        End If
[解决办法]
不过如果你还是需要,可以看看下面的链接,有关vb.net注册表操作方面的:
VB.Net操作注册表实例
VB.NET注册表编程
MSDN:
RegistryKey Class

读书人网 >VB Dotnet

热点推荐