How to read and write a value from the Windows CE registry?

How do you insert a value 1into a property CDInsertin HKEY_LOCAL_MACHINE\SOFTWARE\WJST\WLANand read it back?

+5
source share
1 answer

http://msdn.microsoft.com/en-us/library/microsoft.win32.registry%28v=VS.90%29.aspx

Try the following:

//using Microsoft.Win32;

RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\WJST\WLAN", true); 

// set value of "CDInsert" to 1
reg.SetValue("CDInsert", 1, RegistryValueKind.DWord);

// get value of "CDInsert"; return 0 if value not found
int value = (int)reg.GetValue("CDInsert", 0);
+5
source

All Articles