انجام عملیات متداول در رجیستری ویندوز
شنبه 24 خرداد 1393 3:17 AM
انجام عملیات متداول در رجیستری ویندوز
using Microsoft.Win32;
// <font color="RoyalBlue"><b>Create SubKey</b></font> Registry.LocalMachine.CreateSubKey(@"Software\Sinp in", RegistryKeyPermissionCheck.ReadWriteSubTree); //<b><font color="RoyalBlue">Create Key and Set Value</font></b> RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"Software\Sinpin ", true); reg.SetValue("DWord", "1", RegistryValueKind.DWord); reg.SetValue("ExpandString", "1", RegistryValueKind.ExpandString); reg.SetValue("QWord", "1", RegistryValueKind.QWord); reg.SetValue("String", "1", RegistryValueKind.String); reg.SetValue("Unknown", "1", RegistryValueKind.Unknown); //<font color="Red"> <font color="RoyalBlue"><b>Delete Key</b></font></font> reg.DeleteValue("DWOrd"); //<b><font color="RoyalBlue"> Delete SubKey</font></b> Registry.LocalMachine.DeleteSubKey(@"Software\Sinp in"); // <b><font color="RoyalBlue">Read Key Value</font></b> string val = reg.GetValue("QWord").ToString(); // <font color="RoyalBlue"><b>Retrieve All Keys</b></font> foreach (string s in reg.GetValueNames()) MessageBox.Show(s);
ترکی زبان قربون صدقه رفتنه داریم که: گوزلرین گیلهسین قاداسین آلیم که یعنی درد و بلای مردمک چشات به جونم …!.