Vista + VB.NET - Access Denied while writing to HKEY_LOCAL_MACHINE

前端 未结 3 1158
挽巷
挽巷 2021-01-23 21:39

I want my program to be able to edit a values within a registry key that resides in \'HKEY_LOCAL_MACHINE\'

    My.Computer.Registry.SetValue(\"HKEY_LOCAL_MACHINE         


        
3条回答
  •  无人及你
    2021-01-23 22:02

    Vista has tighter restrictions around Adminstrator accounts. If you're not logged in as an Administrator account, you'll have to write to HKEY_CURRENT_USER as opposed to HKEY_LOCAL_MACHINE.

    IMO, this makes more sense. Each user has their own settings/etc for their programs. If you want to make global settings for your program, you'll have to do it with an Administrator account.

提交回复
热议问题