本文整理汇总了C#中Microsoft.Win32.RegistryKey.Flush方法的典型用法代码示例。如果您正苦于以下问题:C# RegistryKey.Flush方法的具体用法?C# RegistryKey.Flush怎么用?C# RegistryKey.Flush使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Win32.RegistryKey
的用法示例。
在下文中一共展示了RegistryKey.Flush方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddFreddyToRegistry
private static void AddFreddyToRegistry()
{
_key = Registry.CurrentUser.CreateSubKey("SpringIocQuickStartVariableSources");
_key.SetValue("freddy_name", "Freddy Rumsen");
_key.SetValue("freddy_age", 44, RegistryValueKind.DWord);
_key.Flush();
}
示例2: AddFreddyToRegistry
private static void AddFreddyToRegistry()
{
_key = Registry.CurrentUser.CreateSubKey(_subkey);
_key.SetValue("freddy_name", "Freddy Rumsen");
_key.SetValue("freddy_age", 44, RegistryValueKind.DWord);
_key.Flush();
}
示例3: Configuration
public Configuration()
{
OperatingSystem os = Environment.OSVersion;
Console.WriteLine ("OS platform: " + os.Platform);
this.platform = os.Platform.ToString ();
if (this.platform.StartsWith ("Win")) {
RegistryKey CurrentUserKey = Microsoft.Win32.Registry.CurrentUser;
string OurAppKeyStr = @"SOFTWARE\moNotationalVelocity";
OurAppRootKey = CurrentUserKey.CreateSubKey (OurAppKeyStr);
ConfigKey = OurAppRootKey.CreateSubKey ("config");
this.notesDirPath = ConfigKey.GetValue ("notesDirPath") as string;
if (this.notesDirPath == null) {
Console.WriteLine ("No configuration");
this.notesDirPath = defaulNotesDirtPath;
ConfigKey.SetValue ("notesDirPath", this.notesDirPath, RegistryValueKind.String);
}
ConfigKey.Flush ();
} else {
this.notesDirPath = defaulNotesDirtPath;
}
}
示例4: SetUp
public void SetUp()
{
key = Registry.CurrentUser.CreateSubKey("RegistryVariableSourceTests");
key.SetValue("name", "Aleks Seovic");
key.SetValue("computer_name", "%COMPUTERNAME% is the name of my computer", RegistryValueKind.ExpandString);
key.SetValue("age", 32, RegistryValueKind.DWord);
key.SetValue("family", new string[] {"Marija", "Ana", "Nadja"});
key.SetValue("bday", new byte[] {24, 8, 74});
key.Flush();
}
示例5: DisableService
private void DisableService(RegistryKey regkey,
System.Windows.Forms.ComboBox serviceComboBox,
System.Windows.Forms.CheckBox enableCheckBox)
{
serviceComboBox.Enabled = false;
if (regkey.ValueCount > 0)
{
string[] names = regkey.GetValueNames();
serviceComboBox.Text = names[0];
foreach (string service in names)
{
regkey.SetValue(service, "False");
}
regkey.Flush();
}
}
示例6: saveConfigurationData
private void saveConfigurationData()
{
try
{
regConnectionDetails = Registry.CurrentUser.OpenSubKey("Software\\OyRemote\\ConnectionDetails", true);
regConnectionDetails.SetValue("AmplifierIP", txtIP.Text);
regConnectionDetails.SetValue("AmplifierPort", txtPort.Text);
regConnectionDetails.SetValue("BatchDelay", batchDelay);
regConnectionDetails.SetValue("Autoconnect", checkBoxAutoConnect.Checked);
regConnectionDetails.SetValue("CheckVolume", checkBoxVolumeContinuous.Checked);
regBatchCommands = Registry.CurrentUser.OpenSubKey("Software\\OyRemote\\BatchCommands", true);
regBatchCommands.SetValue("Batch1Name", textBoxBatchName1.Text);
regBatchCommands.SetValue("Batch1Command", textBoxBatchCommand1.Text);
regBatchCommands.SetValue("Batch1Autorun", checkBoxAutorunBatch1.Checked);
regBatchCommands.SetValue("Batch2Name", textBoxBatchName2.Text);
regBatchCommands.SetValue("Batch2Command", textBoxBatchCommand2.Text);
regBatchCommands.SetValue("Batch2Autorun", checkBoxAutorunBatch2.Checked);
regBatchCommands.SetValue("Batch3Name", textBoxBatchName3.Text);
regBatchCommands.SetValue("Batch3Command", textBoxBatchCommand3.Text);
regBatchCommands.SetValue("Batch3Autorun", checkBoxAutorunBatch3.Checked);
regBatchCommands.SetValue("Batch4Name", textBoxBatchName4.Text);
regBatchCommands.SetValue("Batch4Command", textBoxBatchCommand4.Text);
regBatchCommands.SetValue("Batch4Autorun", checkBoxAutorunBatch4.Checked);
regBatchCommands.SetValue("Batch5Name", textBoxBatchName5.Text);
regBatchCommands.SetValue("Batch5Command", textBoxBatchCommand5.Text);
regBatchCommands.SetValue("Batch5Autorun", checkBoxAutorunBatch5.Checked);
regBatchCommands.SetValue("Batch6Name", textBoxBatchName6.Text);
regBatchCommands.SetValue("Batch6Command", textBoxBatchCommand6.Text);
regBatchCommands.SetValue("Batch6Autorun", checkBoxAutorunBatch6.Checked);
for (int i = 0; i < numberOfLMDPresets; i++)
{
regLMDpresets.SetValue(("LMD" + i + "Label"), lmdPreset[i].getLabel());
regLMDpresets.SetValue(("LMD" + i + "Preset"), lmdPreset[i].getCommand());
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
regConnectionDetails.Flush();
regConnectionDetails.Close();
}
示例7: PersistKeyChanges
//Calls the flush method, to make the write effective.
public void PersistKeyChanges(RegistryKey parentKey)
{
log("Flushing contents of key: " + parentKey.Name +".");
//parentKey.Close();
///When the key is closed, it is automatically flushed.
parentKey.Flush();
}