473,508 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to detect the deleting permission for Registry key?

YXQ
How to detect programmatically if current user has the deleting permission
to delete a Registry key in VS 2005? thank you very much!

Dec 22 '06 #1
5 1821
Public Function GetAccessControl As RegistrySecurity

Dim instance As RegistryKey
Dim returnValue As RegistrySecurity

returnValue = instance.GetAccessControl
"YXQ" <ga***@163.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
How to detect programmatically if current user has the deleting permission
to delete a Registry key in VS 2005? thank you very much!

Dec 22 '06 #2
YXQ
I am very grateful if you can give full code.

"vbnetdev" <ad***@kjmsolutions.comдÈëÏûÏ¢
news:%2****************@TK2MSFTNGP04.phx.gbl...
Public Function GetAccessControl As RegistrySecurity

Dim instance As RegistryKey
Dim returnValue As RegistrySecurity

returnValue = instance.GetAccessControl
"YXQ" <ga***@163.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>How to detect programmatically if current user has the deleting
permission to delete a Registry key in VS 2005? thank you very much!

Dec 22 '06 #3
Be careful of the 163.com spam gang & comcast.net who are both using these
newsgroups
"YXQ" <ga***@163.comwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
I am very grateful if you can give full code.

"vbnetdev" <ad***@kjmsolutions.comдÈëÏûÏ¢
news:%2****************@TK2MSFTNGP04.phx.gbl...
Public Function GetAccessControl As RegistrySecurity

Dim instance As RegistryKey
Dim returnValue As RegistrySecurity

returnValue = instance.GetAccessControl
"YXQ" <ga***@163.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
How to detect programmatically if current user has the deleting
permission to delete a Registry key in VS 2005? thank you very much!

Dec 22 '06 #4
This will bomb as not accetpable. If you change it to currentuser if you
have admin success it shoudl proceed without problem.

Sub Test3()
Dim regKey As Microsoft.Win32.RegistryKey =
Microsoft.Win32.Registry.LocalMachine

Try
regKey.OpenSubKey("console",
Microsoft.Win32.RegistryKeyPermissionCheck.ReadWri teSubTree,
System.Security.AccessControl.RegistryRights.Delet e).ToString()
Catch ex As Exception
MessageBox.Show("The specified access to the key was not
possible")
End Try

End Sub
"YXQ" <ga***@163.comwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
>I am very grateful if you can give full code.

"vbnetdev" <ad***@kjmsolutions.comдÈëÏûÏ¢
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Public Function GetAccessControl As RegistrySecurity

Dim instance As RegistryKey
Dim returnValue As RegistrySecurity

returnValue = instance.GetAccessControl
"YXQ" <ga***@163.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>How to detect programmatically if current user has the deleting
permission to delete a Registry key in VS 2005? thank you very much!


Dec 22 '06 #5
yxq
Thank you.

"vbnetdev" <ad***@kjmsolutions.comдÈëÏûÏ¢ÐÂÎÅ:uj************ **@TK2MSFTNGP03.phx.gbl...
This will bomb as not accetpable. If you change it to currentuser if you
have admin success it shoudl proceed without problem.

Sub Test3()
Dim regKey As Microsoft.Win32.RegistryKey =
Microsoft.Win32.Registry.LocalMachine

Try
regKey.OpenSubKey("console",
Microsoft.Win32.RegistryKeyPermissionCheck.ReadWri teSubTree,
System.Security.AccessControl.RegistryRights.Delet e).ToString()
Catch ex As Exception
MessageBox.Show("The specified access to the key was not
possible")
End Try

End Sub
"YXQ" <ga***@163.comwrote in message
news:uB**************@TK2MSFTNGP02.phx.gbl...
>>I am very grateful if you can give full code.

"vbnetdev" <ad***@kjmsolutions.comдÈëÏûÏ¢
news:%2****************@TK2MSFTNGP04.phx.gbl...
>>Public Function GetAccessControl As RegistrySecurity

Dim instance As RegistryKey
Dim returnValue As RegistrySecurity

returnValue = instance.GetAccessControl
"YXQ" <ga***@163.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl.. .
How to detect programmatically if current user has the deleting
permission to delete a Registry key in VS 2005? thank you very much!



Dec 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
19117
by: Yitzhak | last post by:
I am having "Permission denied" error while calling LogEvent method of WScript.Shell component. Basically, ASP page calls Windows Script Host Shell component to log events to the OS Application...
13
9475
by: Bob Darlington | last post by:
I have a repair and backup database routine which runs when a user closes down my application. It works fine in my development machine, but breaks on a client's at the following line: If...
7
14811
by: Bob | last post by:
I'm working on a Windows app that needs to write to the Registry HKLM. I keep getting a "System.UnauthorizedAccessException: Cannot write to the registry key." error when running the app. I'm...
2
3226
by: Sachin | last post by:
Hi All, I am using aspnet_setreg.exe to encrypt the username and password and store them in Web.Config file for impersonation. I have given ASPNET and Impersonation account to read the...
2
1779
by: Harry Barker | last post by:
Hi Group I Have to complete a small project and i need you guys help in doing it. I have to create a Tool that will automatically delete a file from the Harddrive and also deleting a SubKey from...
7
1821
by: eSolTec, Inc. 501(c)(3) | last post by:
Thank you in advance for any and all assistance. I have an application that pulls files, folders and registry keys of installed programs. I'm wanting to with a context menu selection of "Delete...
5
2075
by: Sandeep Singh Sekhon | last post by:
I am Developing a Web Application with ASP.NET 1.1 I have one project Folder which is virtual directory of IIS. In this directory, I have one Folder named Photos in which I used to Store Photos....
7
1191
by: Austin Myers | last post by:
I need to be able to programmincally set (USER) permissions on a registry key. I've read the Knowledge Base articles and they all point to a couple of articles that seem to have been pulled form...
4
3218
by: yxq | last post by:
Hello, I want to get the registry key permission information whether current user has the permission to delete the registry key using RegistryRights, how to do? thank you.
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.