Setting Registry key write permissions using .NET

前端 未结 4 1338
广开言路
广开言路 2020-12-15 07:31

I\'m trying to grant Write access to my application\'s registry settings to everyone or all users of a machine during the install process.

My application does not

4条回答
  •  独厮守ぢ
    2020-12-15 07:53

    try this

     new   System.Security.Permissions.RegistryPermission(System.Security.Permissions.PermissionState.Unrestricted).Assert();
    try
    {
    //Your code
    }catch
    {
    }finally
    {
           System.Security.Permissions.RegistryPermission.RevertAssert();
    }
    

提交回复
热议问题