G
Guest
I am trying to read the value of the registry located in
HKEY_LOCAL_MACHINE\Security\Policy\PolAdtEv because it is a binary
representation of the "audit policy" settings on the computer. If I can read
it and break into the appropriate pieces I can determine the audit settings
on a remote computer. I almost have this working. The code below will
return a '0' for the value which is the first digit of the value I am trying
to read. I am not sure how to get the rest of the values in the string
(almost 90 binary digits). Anyone have any ideas? Thanks in advance.
RegistryKey rk;
remotename = "pc0057963";
string subkey = "Security\\Policy\\PolAdtEv";
rk = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,remotename)
..OpenSubKey(subkey);
// Print the values.
listBox1.Items.Add("There are " + rk.ValueCount.ToString() +
" values for " + rk.Name.ToString() + ".");
listBox2.Items.Add(Convert.ToByte(rk.GetValue("")));
HKEY_LOCAL_MACHINE\Security\Policy\PolAdtEv because it is a binary
representation of the "audit policy" settings on the computer. If I can read
it and break into the appropriate pieces I can determine the audit settings
on a remote computer. I almost have this working. The code below will
return a '0' for the value which is the first digit of the value I am trying
to read. I am not sure how to get the rest of the values in the string
(almost 90 binary digits). Anyone have any ideas? Thanks in advance.
RegistryKey rk;
remotename = "pc0057963";
string subkey = "Security\\Policy\\PolAdtEv";
rk = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,remotename)
..OpenSubKey(subkey);
// Print the values.
listBox1.Items.Add("There are " + rk.ValueCount.ToString() +
" values for " + rk.Name.ToString() + ".");
listBox2.Items.Add(Convert.ToByte(rk.GetValue("")));