Click here to Skip to main content
15,898,980 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: help needed pls Pin
Umangj25-Nov-08 4:04
Umangj25-Nov-08 4:04 
GeneralRe: help needed pls Pin
Luc Pattyn25-Nov-08 4:15
sitebuilderLuc Pattyn25-Nov-08 4:15 
GeneralRe: help needed pls Pin
Umangj25-Nov-08 4:57
Umangj25-Nov-08 4:57 
QuestionVisual Basic.net User Control Pin
Ryno Engelbrecht24-Nov-08 23:18
Ryno Engelbrecht24-Nov-08 23:18 
AnswerRe: Visual Basic.net User Control Pin
Jon_Boy25-Nov-08 1:32
Jon_Boy25-Nov-08 1:32 
AnswerRe: Visual Basic.net User Control Pin
Ryno Engelbrecht25-Nov-08 1:52
Ryno Engelbrecht25-Nov-08 1:52 
GeneralRe: Visual Basic.net User Control Pin
Jon_Boy25-Nov-08 3:42
Jon_Boy25-Nov-08 3:42 
QuestionRequested registry access is not allowed Pin
Member 445034221-Nov-08 5:55
Member 445034221-Nov-08 5:55 
I'm getting "Requested registry access is not allowed" error while trying to open the subkey.

I'm trying to set permissions for a particular subkey using registry class.

I want to set permissions for "HKLM\SYSTEM\CurrentControlSet\Services\USBSTOR\"

Currently for USBSTOR "everyone" is not added.



the code is as follows:
<br />
Imports System<br />
Imports System.Windows<br />
Imports System.Reflection<br />
Imports System.Runtime.InteropServices<br />
Imports System.Security<br />
Imports System.Security.Policy.ApplicationTrust<br />
Imports System.Security.Policy.CodeGroup<br />
Imports System.Security.Policy<br />
Imports System.Security.PermissionSet<br />
Imports System.Security.AccessControl<br />
Imports System.Security.Permissions<br />
Imports Microsoft.Win32<br />
Imports Microsoft.Win32.Registry<br />
Imports Registry.My.Resources<br />
Imports System.Collections<br />
Imports System.ComponentModel<br />
<br />
<Assembly: PermissionSetAttribute(SecurityAction.RequestMinimum, Name:="FullTrust")> <br />
<br />
Public Class USB_Storage<br />
<br />
    Private Const reg_key_a As String = "SYSTEM\CurrentControlSet\Services\USBSTOR\"<br />
<br />
<br />
    Private Sub btnEnable_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnable.Click<br />
<br />
        Dim rk As RegistryKey = Registry.My.Computer.Registry.LocalMachine<br />
<br />
        Dim user As String = "everyone"<br />
        Dim rs As New RegistrySecurity()<br />
        rs.AddAccessRule(New RegistryAccessRule(user, _<br />
           RegistryRights.WriteKey, _<br />
          InheritanceFlags.None, _<br />
         PropagationFlags.None, _<br />
         AccessControlType.Allow))<br />
<br />
        rk.OpenSubKey(reg_key_a, True).SetAccessControl(rs)<br />
<br />
    End Sub<br />
<br />
End Class<br />


Please suggest.. thanks in advance.
- Musthafa
GeneralRe: Requested registry access is not allowed Pin
Paul Conrad21-Nov-08 6:29
professionalPaul Conrad21-Nov-08 6:29 
AnswerRe: Requested registry access is not allowed Pin
Dave Kreskowiak21-Nov-08 7:36
mveDave Kreskowiak21-Nov-08 7:36 
QuestionProblem while creating Sharepoint custome Tmer Job Pin
Krunal3919-Nov-08 21:20
Krunal3919-Nov-08 21:20 
QuestionCan I do assembly binding with major, minor but not build? Pin
pdohara19-Nov-08 10:12
pdohara19-Nov-08 10:12 
RantSystem.Windows.Forms.DateTimePicker.BackColor Pin
PIEBALDconsult19-Nov-08 7:06
mvePIEBALDconsult19-Nov-08 7:06 
GeneralRe: System.Windows.Forms.DateTimePicker.BackColor Pin
Jared Bienz [MSFT]19-Nov-08 8:14
Jared Bienz [MSFT]19-Nov-08 8:14 
GeneralRe: System.Windows.Forms.DateTimePicker.BackColor Pin
PIEBALDconsult19-Nov-08 14:02
mvePIEBALDconsult19-Nov-08 14:02 
GeneralRe: System.Windows.Forms.DateTimePicker.BackColor Pin
loricheung20-Aug-09 17:06
loricheung20-Aug-09 17:06 
GeneralRe: System.Windows.Forms.DateTimePicker.BackColor Pin
PIEBALDconsult20-Aug-09 17:24
mvePIEBALDconsult20-Aug-09 17:24 
QuestionECMAScript 327 on .Net Compact Framework Pin
SebastienBR19-Nov-08 5:24
SebastienBR19-Nov-08 5:24 
AnswerRe: ECMAScript 327 on .Net Compact Framework Pin
Simon P Stevens25-Nov-08 0:35
Simon P Stevens25-Nov-08 0:35 
QuestionMemory Leak in .net 2.0 Datagridview Pin
Skeletor2318-Nov-08 5:16
Skeletor2318-Nov-08 5:16 
QuestionLocalReport.Render in ASP.NET Pin
Member 183766118-Nov-08 4:39
Member 183766118-Nov-08 4:39 
AnswerRe: LocalReport.Render in ASP.NET Pin
dp.sistemas23-Sep-09 3:00
dp.sistemas23-Sep-09 3:00 
QuestionFile System Virtual Directories Pin
Tristan Rhodes18-Nov-08 2:38
Tristan Rhodes18-Nov-08 2:38 
AnswerRe: File System Virtual Directories Pin
Dave Kreskowiak18-Nov-08 4:08
mveDave Kreskowiak18-Nov-08 4:08 
GeneralRe: File System Virtual Directories Pin
Tristan Rhodes18-Nov-08 4:55
Tristan Rhodes18-Nov-08 4:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.