1
我想嘗試更改網絡設置級別與VB.NET
BC30451「RegistryValueKind」未聲明
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim regKey As Microsoft.Win32.RegistryKey
regKey = Microsoft.Win32.RegistryKey.OpenBaseKey("Software\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\3\", True)
regKey.SetValue("2400", 0, RegistryValueKind.DWord)
End Sub
End Class
我得到這個錯誤: BC30451「RegistryValueKind」未聲明。由於其保護級別爲,可能無法訪問。
有沒有解決方案?
您是否想要爲當前用戶或所有用戶更改它。我相信這是你的問題,所有的用戶.... – Codexer
看起來也許你沒有'Microsoft.Win32'的導入,所以也許'Microsoft.Win32.RegistryValueKind.DWord'是你需要的嗎? – Mark
@Mark'Microsoft.Win32.RegistryValueKind.DWord'不是一個有效的命名空間,'RegistryValueKind'是一個枚舉... – Codexer