当前位置: 首页>>代码示例>>C#>>正文


C# RegistryKey.Flush方法代码示例

本文整理汇总了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();
 }
开发者ID:serra,项目名称:spring-net-examples,代码行数:7,代码来源:Program.cs

示例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();
 }
开发者ID:serra,项目名称:spring-net-examples,代码行数:7,代码来源:RegistryVariableSourceTests.cs

示例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;
            }
        }
开发者ID:mzehrer,项目名称:monovel,代码行数:28,代码来源:Configuration.cs

示例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();
        }
开发者ID:Binodesk,项目名称:spring-net,代码行数:10,代码来源:RegistryVariableSourceTests.cs

示例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();
            }
        }
开发者ID:psyCHOder,项目名称:conferencexp,代码行数:17,代码来源:frmServices.cs

示例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();
        }
开发者ID:flipswitchingmonkey,项目名称:oyremote,代码行数:45,代码来源:Form1.cs

示例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();
 }
开发者ID:michael-manley,项目名称:nvpmmgr,代码行数:8,代码来源:RegistryManager.cs


注:本文中的Microsoft.Win32.RegistryKey.Flush方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。