當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。