Login Register






[VB.NET]How to compare two registry values? filter_list
Author
Message
[VB.NET]How to compare two registry values? #1
Hi,
How to compare two registry values ​​so that if the value is 0, for example, display the order is enabled and if it shows that 2 is disabled.

Reply

RE: [VB.NET]How to compare two registry values? #2
i don't really get what you mean. can you tell us what application your making?
(This post was last modified: 05-05-2011, 09:55 AM by Skullmeat.)
Pierce the life fibers with your drill.

Reply

RE: [VB.NET]How to compare two registry values? #3
Code:
Dim key As RegistryKey = Registry.CurrentUser Dim subkey As RegistryKey subkey = key.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", True) subkey.SetValue("DisableRegistryTools", 0) Interaction.MsgBox("Edytor Rejestru został włączony :)", MsgBoxStyle.OkOnly, Nothing)
If this value DisableRegistryTools = 0, in order to display the registry editor is enabled and sory for my bad english

Reply

RE: [VB.NET]How to compare two registry values? #4
Code:
Dim key As Microsoft.Win32.RegistryKey = Registry.CurrentUser Dim subkey As Microsoft.Win32.RegistryKey = key.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", True) Dim Enabled As Byte = subkey.GetValue("DisableRegistryTools") If Enabled = 0 Then MsgBox("Registry is not Disabled!", MsgBoxStyle.Information) Else MsgBox("Registry is Disabled!", MsgBoxStyle.Information) End If

is this what you meant? Smile
Pierce the life fibers with your drill.

Reply

RE: [VB.NET]How to compare two registry values? #5
something
Code:
Dim key As Microsoft.Win32.RegistryKey = Registry.CurrentUser Dim subkey As Microsoft.Win32.RegistryKey = key.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", True) Dim Enabled As Byte = subkey.GetValue("DisableRegistryTools") If Enabled = 0 Then Label11.Text = "Registry is not Disabled" Else Label11.Text = "Registry is Disabled!" End If
just to program check it before pressing the button or checkbox

Reply

RE: [VB.NET]How to compare two registry values? #6
(05-05-2011, 10:23 AM)DonCorleone Wrote: something
Code:
Dim key As Microsoft.Win32.RegistryKey = Registry.CurrentUser Dim subkey As Microsoft.Win32.RegistryKey = key.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", True) Dim Enabled As Byte = subkey.GetValue("DisableRegistryTools") If Enabled = 0 Then Label11.Text = "Registry is not Disabled" Else Label11.Text = "Registry is Disabled!" End If
just to program check it before pressing the button or checkbox

Nie rozumiem o co Ci chodzi dokładnie, ale myślę, że chcesz sprawdzić, czy zegar rejestru jest włączony, czy nie. jeżeli niepełnosprawnych przycisk można kliknąć, bo nie można kliknąć przycisk. mam rację, i?

www.translate.google.com 'What can i say when people can't speak english Tongue
Pierce the life fibers with your drill.

Reply

RE: [VB.NET]How to compare two registry values? #7
I want a program that verifies whether the option is enabled or not

Reply

RE: [VB.NET]How to compare two registry values? #8
That's what hotmaster posted above.

Code:
If My.Computer.Registry.GetValue("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "DisableRegistryTools", 0) = "0" Then Label1.Text = "Disabled" Else Label1.Text = "Enabled" End If

You get String Values as String, and DWORD values as Double, from the Registry. Just compare them like you are comparing a TextBox.
[Image: rytwG00.png]
Redcat Revolution!

Reply