private bool SetValue()
{//修改注册表
// try
// {//HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/PageSetup
// Registry key=Registry.CurrentUser.OpenSubKey(@"Software/Microsoft/Internet Explorer/PageSetup",true);
// RegistryKey key1 = Registry.CurrentUser.OpenSubKey("HKEY_CURRENT_USER",true);
RegistryKey key2 = Registry.CurrentUser.OpenSubKey("Software",true);
RegistryKey key3= key2.OpenSubKey("Microsoft",true);
RegistryKey key4=key3.OpenSubKey("Internet Explorer",true);
RegistryKey key5=key4.OpenSubKey("PageSetup",true);
// object strf = key5.GetValue("footer");
// object strh=key.GetValue("header");
// if(strf.ToString() != String.Empty)
key5.SetValue("footer",null);//修改键值
key5.SetValue("header",null);//修改键值
key5.Flush();
key5.Close();
return true;
// }
// catch
// {
// return false;
// }
}
{//修改注册表
// try
// {//HKEY_CURRENT_USER/Software/Microsoft/Internet Explorer/PageSetup
// Registry key=Registry.CurrentUser.OpenSubKey(@"Software/Microsoft/Internet Explorer/PageSetup",true);
// RegistryKey key1 = Registry.CurrentUser.OpenSubKey("HKEY_CURRENT_USER",true);
RegistryKey key2 = Registry.CurrentUser.OpenSubKey("Software",true);
RegistryKey key3= key2.OpenSubKey("Microsoft",true);
RegistryKey key4=key3.OpenSubKey("Internet Explorer",true);
RegistryKey key5=key4.OpenSubKey("PageSetup",true);
// object strf = key5.GetValue("footer");
// object strh=key.GetValue("header");
// if(strf.ToString() != String.Empty)
key5.SetValue("footer",null);//修改键值
key5.SetValue("header",null);//修改键值
key5.Flush();
key5.Close();
return true;
// }
// catch
// {
// return false;
// }
}