 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Mon Jun 23, 2008 3:57 pm Post subject: Registry help .Net |
|
|
Made a quick client with just a simple textbox and a button on it.
In the button:
| Code: | | My.Computer.Registry.SetValue("HKEY_CURRENT_USER\TestKey", "CheckBox Values", CheckBox1) |
In the form load:
| Code: | Dim readValue As String = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\TestKey", "CheckBox Values", Nothing)
If readValue = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\TestKey", "CheckBox Values", 1) Then
MsgBox("Registry updated")
CheckBox1.Checked = True
Else : CheckBox1.Checked = False
End If |
Its just not working. The box keeps becoming checked, and un checking is not staying.
_________________
|
|
| Back to top |
|
 |
killersamurai Expert Cheater
Reputation: 0
Joined: 10 Sep 2007 Posts: 197 Location: Colorado
|
Posted: Mon Jun 23, 2008 5:15 pm Post subject: |
|
|
From looking at the code you posted, there can be other problems in your code you didn't post. So, I just created an example. It's done in c# since I haven't touched vb.net in a very long time. Someone might be nice enough to translate it though.
| Code: |
private void btnSValue_Click(object sender, EventArgs e)
{
if (txtSValue.Text != String.Empty)
{
Microsoft.Win32.RegistryKey regSet = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(
"Software\\Test\\Key",
Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree,
System.Security.AccessControl.RegistryRights.WriteKey);
if (regSet == null)
{
regSet = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(
"Software\\Test\\Key",
Microsoft.Win32.RegistryKeyPermissionCheck.ReadWriteSubTree);
MessageBox.Show(
"Key created!",
"OK",
MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
regSet.SetValue(
"Value",
txtSValue.Text,
Microsoft.Win32.RegistryValueKind.String);
MessageBox.Show(
"Done",
"OK",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
regSet.Close();
}
else
MessageBox.Show(
"You need to enter something",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
}
private void btnGValue_Click(object sender, EventArgs e)
{
Microsoft.Win32.RegistryKey regGet = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(
"Software\\Test\\Key",
Microsoft.Win32.RegistryKeyPermissionCheck.ReadSubTree,
System.Security.AccessControl.RegistryRights.QueryValues);
if (regGet == null)
MessageBox.Show(
"Key doesn't exist. Set value first!",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Exclamation);
else
{
if (regGet.GetValue("Value", txtGValue.Text, Microsoft.Win32.RegistryValueOptions.DoNotExpandEnvironmentNames) != null)
{
txtGValue.Text = (string)regGet.GetValue(
"Value",
txtGValue.Text,
Microsoft.Win32.RegistryValueOptions.DoNotExpandEnvironmentNames);
}
}
regGet.Close();
}
|
|
|
| Back to top |
|
 |
AndrewMan Grandmaster Cheater Supreme
Reputation: 0
Joined: 01 Aug 2007 Posts: 1257
|
Posted: Mon Jun 23, 2008 6:35 pm Post subject: |
|
|
Thanks for that code. If someone could just translate that, it would be great.
_________________
|
|
| Back to top |
|
 |
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Mon Jun 23, 2008 6:41 pm Post subject: |
|
|
| AndrewMan wrote: | | Thanks for that code. If someone could just translate that, it would be great. |
There are a number of C# -> VB.NET translators on the internet.
Please use Google.
_________________
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|