读书人

asp.net读注册表有关问题高手过来看

发布时间: 2012-03-03 15:33:03 作者: rapoo

asp.net读注册表问题,高手过来看一下
VB.net的

Sub Readreg()
Dim reg As Microsoft.Win32.RegistryKey, subreg As Microsoft.Win32.RegistryKey
reg = Microsoft.Win32.Registry.CurrentUser
subreg = reg.OpenSubKey( "Software\Eoffice\Run ", True)
If Not subreg Is Nothing Then
If subreg.GetValue( "No ") <> " " Then
Dim str As Object = subreg.GetValue( "No ")
lblSimpleCode.Text = str.ToString()
Else
lblSimpleCode.Text = "empty "
End If
Else
lblSimpleCode.Text = "NO Key "
End If
End Sub

为什么subreg总是nothing??,我确定键值是一定存在的。
我用winform运行正确,请教各位。谢

[解决办法]
既然不是我说的错误,也只能帮顶了...

读书人网 >asp.net

热点推荐