Please help me in Registry
hi,
I want to prevent the user to open the CD ,so i write the following code:
private void WriteValue(int Val )
{
RegistryKey key =Registry.CurrentUser;
try
{
RegistryKey valKey = key.OpenSubKey (@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);
if(valKey == null)
{
key.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer");
}
valKey.SetValue("NoCDBurning", Val);
}
catch(Exception er)
{
MessageBox.Show(er.Message, "My Appli", MessageBoxButtons.OK, MessageBoxIcon.Stop);
}
finally
{
_key.Close();
}
}
but also i can open the cd ,i don not know what is the error in my code???
Thanks