VB.net代码.aspx页面中注册表项值设置
Dim header As String
Dim footer As String
Dim margin_left As String
Dim margin_top As String
Dim margin_bottom As String
Dim bottom As Double
footer = ""
header = ""
IERegKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Internet Explorer\\PageSetup", True)
'footer = IERegKey.GetValue("footer", 0)
'header = IERegKey.GetValue("header", 0)
'margin_top = IERegKey.GetValue("margin_top", 0)
'margin_bottom = IERegKey.GetValue("margin_bottom", 0)
bottom = 0.25
IERegKey.SetValue("footer", "")
'IERegKey.SetValue("header", "")
''IERegKey.SetValue("margin_top", bottom)
'IERegKey.SetValue("margin_bottom", 0)
当项目从工作项目运行,将工作正常。 但是当做websetup并尝试运行页面后,它将显示错误为
异常详细信息:System.NullReferenceException:未将对象引用设置为对象的实例。
源错误:
线56:“margin_bottom = IERegKey.GetValue( “margin_bottom”,0) 线57:底部= 0.25 线58:IERegKey.SetValue( “页脚”, “”) 59号线:“IERegKey.SetValue( “头”, “”)60 行: '' IERegKey.SetValue( “margin_top”,底部)
我怎样才能恢复的问题,请帮我