这是我的代码:
import winreg as wreg
key = wreg.OpenKey(wreg.HKEY_LOCAL_MACHINE, r'SYSTEM\CurrentControlSet\Services\Tcpip\Parameters',wreg.KEY_ALL_ACCESS)
wreg.SetValueEx(key,"IPEnableRouter", 0, wreg.REG_DWORD, 1)
当我运行这个脚本时,它说
PermissionError: [WinError 5] Access is Denied
如何将值更改为 0 到 1 或 1 到 0?