Dim n As Integer = GetConfigValue("Count",1)
Dim Code As String = GetConfigValue("Register" & ComputerId,"")
Dim Ok As Boolean
Dim dr As DataRow= DataTables("注册表").Find("注册码= 'code'")
If Code > "" AndAlso DecryptText(Code,"cba","cba") = ComputerId Then '如果注册码正确
OK = True
If dr("禁用") = True AndAlso user.name <> "开发者" Then
Messagebox.Show("您正在使用的产品已被开发者关闭,请与开发者联系!")
Syscmd.Project.Exit()
End If
Else
If n > 1 Then
Messagebox.Show("请马上注册!")
Forms("注册表").Open()
Code = GetConfigValue("Register" & ComputerId,"")
If Code > "" AndAlso DecryptText(Code,"cba","cba") = ComputerId Then '如果注册码正确
OK = True
End If
End If
If n > 2 AndAlso Ok = False AndAlso user.name <> "开发者" Then
Messagebox.Show("您正在使用的产品已经超出试用次数!")
Syscmd.Project.Exit()
End If
End If
n = n + 1
SaveConfigValue("Count",n)
系统提示错误如下:
system.nullreferenceException:未将对象引用设置到对象的实例,那程序要如何修改?