1
Reply

Please help me in Registry

kkattamanchi

kkattamanchi

Mar 10 2005 11:14 AM
1.8k
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

Answers (1)