本文整理汇总了C#中Microsoft.Win32.RegistryKey.?.DeleteValue方法的典型用法代码示例。如果您正苦于以下问题:C# RegistryKey.?.DeleteValue方法的具体用法?C# RegistryKey.?.DeleteValue怎么用?C# RegistryKey.?.DeleteValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Win32.RegistryKey
的用法示例。
在下文中一共展示了RegistryKey.?.DeleteValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Button1Click
//.........这里部分代码省略.........
MainForm.Iconfont = new Font(FontFamily.GenericSansSerif, MainForm.Conf.BigButtons ? 22 : 15, FontStyle.Bold, GraphicsUnit.Pixel);
MainForm.Conf.TalkMic = "";
if (ddlTalkMic.Enabled)
{
if (ddlTalkMic.SelectedIndex>0)
MainForm.Conf.TalkMic = ddlTalkMic.SelectedItem.ToString();
}
MainForm.Conf.MinimiseOnClose = chkMinimise.Checked;
MainForm.Conf.JPEGQuality = (int) numJPEGQuality.Value;
MainForm.Conf.IPv6Disabled = !chkEnableIPv6.Checked;
MainForm.SetPriority();
var ips = rtbAccessList.Text.Trim().Split(',');
var t = ips.Select(ip => ip.Trim()).Where(ip2 => ip2 != "").Aggregate("", (current, ip2) => current + (ip2 + ","));
MainForm.Conf.AllowedIPList = t.Trim(',');
LocalServer.AllowedIPs = null;
var refs = rtbReferrers.Text.Trim().Split(',');
var t2 = refs.Select(ip => ip.Trim()).Where(ip2 => ip2 != "").Aggregate("", (current, ip2) => current + (ip2 + ","));
MainForm.Conf.Referers = t2.Trim(',');
LocalServer.AllowedReferers = null;
MainForm.Conf.ShowOverlayControls = chkOverlay.Checked;
string lang = ((ListItem) ddlLanguage.SelectedItem).Value[0];
if (lang != MainForm.Conf.Language)
{
ReloadResources = true;
LocRm.Reset();
}
MainForm.Conf.Language = lang;
if (chkStartup.Checked)
{
try
{
_rkApp = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
_rkApp?.SetValue("iSpy", "\"" + Application.ExecutablePath + "\" -silent", RegistryValueKind.String);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
MainForm.LogExceptionToFile(ex);
}
}
else
{
try
{
_rkApp = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
_rkApp?.DeleteValue("iSpy", false);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
MainForm.LogExceptionToFile(ex);
}
}
//SetStorageOptions();
MainForm.ReloadColors();
if (ddlJoystick.SelectedIndex > 0)
{
string nameid = _sticks[ddlJoystick.SelectedIndex - 1];
MainForm.Conf.Joystick.id = nameid.Split('|')[1];
MainForm.Conf.Joystick.XAxis = jaxis1.ID;
MainForm.Conf.Joystick.InvertXAxis = jaxis1.Invert;
MainForm.Conf.Joystick.YAxis = jaxis2.ID;
MainForm.Conf.Joystick.InvertYAxis = jaxis2.Invert;
MainForm.Conf.Joystick.ZAxis = jaxis3.ID;
MainForm.Conf.Joystick.InvertZAxis = jaxis3.Invert;
MainForm.Conf.Joystick.Record = jbutton1.ID;
MainForm.Conf.Joystick.Snapshot = jbutton2.ID;
MainForm.Conf.Joystick.Talk = jbutton3.ID;
MainForm.Conf.Joystick.Listen = jbutton4.ID;
MainForm.Conf.Joystick.Play = jbutton5.ID;
MainForm.Conf.Joystick.Next = jbutton6.ID;
MainForm.Conf.Joystick.Previous = jbutton7.ID;
MainForm.Conf.Joystick.Stop = jbutton8.ID;
MainForm.Conf.Joystick.MaxMin = jbutton9.ID;
}
else
MainForm.Conf.Joystick.id = "";
MainForm.Conf.Logging.Enabled = chkEnableLogging.Checked;
MainForm.Conf.Logging.FileSize = (int)numMaxLogSize.Value;
MainForm.Conf.Logging.KeepDays = (int)numKeepLogs.Value;
DialogResult = DialogResult.OK;
Close();
}
示例2: DeleteKey
public static void DeleteKey(RegistryKey key, string name)
{
key?.DeleteValue(name, false);
}