好吧,我正在玩visual basic,似乎有一段很长的时间开始使用它xD。无论如何不知道为什么我会收到以下错误:
UACLevel_Level
未声明。由于其保护级别,它可能无法访问。
我尝试单击小帮助图标,但它什么也没给我。
Dim ConsentPromptBehaviorAdmin = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "ConsentPromptBehaviorAdmin", Nothing)
Dim EnableLUA = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "EnableLUA", Nothing)
Dim PromptOnSecureDesktop = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "PromptOnSecureDesktop", Nothing)
Dim UACLevel_Value = ConsentPromptBehaviorAdmin + EnableLUA + PromptOnSecureDesktop
If UACLevel_Value = 0 Then
Dim UACLevel_Level = "Never notify me."
ElseIf UACLevel_Value = 6 Then
Dim UACLevel_Level = "Notify me only when programs try to make changes to my computer(do not dim desktop)."
ElseIf UACLevel_Value = 7 Then
Dim UACLevel_Level = "Default - Notify me only when programs try to make changes to my computer."
ElseIf UACLevel_Value = 4 Then
Dim UACLevel_Level = "Always Notify Me"
Else
Dim UACLevel_Level = "Customized UAC Level"
End If
MsgBox("UACLevel is " & UACLevel_Value & ": " & UACLevel_Level)