private const string regMainKey = "Software\\ArLi2003";RegistryKey regRead;
regRead= Registry.CurrentUser.OpenSubKey(regMainKey,false);
if(regRead!=null)
{
this.Top = (int)regRead.GetValue("myTop");
}
regRead.Close();Registry.xx 这里还要确定主键位是user 还是hklm(HKEY_LOCAL_MACHINE\\SOFTWARE)之类的.. ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfMicrosoftWin32RegistryMembersTopic.htm
regRead= Registry.CurrentUser.OpenSubKey(regMainKey,false);
if(regRead!=null)
{
this.Top = (int)regRead.GetValue("myTop");
}
regRead.Close();Registry.xx 这里还要确定主键位是user 还是hklm(HKEY_LOCAL_MACHINE\\SOFTWARE)之类的.. ms-help://MS.VSCC/MS.MSDNVS.2052/cpref/html/frlrfMicrosoftWin32RegistryMembersTopic.htm
RegistryKey regkey = Registry.CurrentUser.OpenSubKey(strRegKey);
用GetValue方法读取,如:
int cx = (int)regkey.GetValue(strName);