using Microsoft.Win32;
// 레지스트리 읽기
public string getReg(string regName)
{
RegistryKey reg = Registry.LocalMachine;
reg = reg.OpenSubKey("Software\\Your Program Name", true);
string regData = "";
if (reg == null)
regData = "";
else
regData = Convert.ToString(reg.GetValue(regName));
return regData;
}
// 레지스트리 쓰기
public void setReg(string regName, string regData)
{
RegistryKey reg = Registry.LocalMachine;
reg = reg.CreateSubKey("Software\\Your Program Name", RegistryKeyPermissionCheck.ReadWriteSubTree);
reg.SetValue(regName, regData, RegistryValueKind.String);
reg.Close();
}