Wednesday, 28 October 2015
How to store values into Registry Editor using C#,ASP.Net
First of all know about How to open Registry Editor:
ShortCut Key - Windows + R press Enter
type regedit press OK , Choose Yes.
C# Code to store data into Registry Editor:-
Below code store data into HKEY_CURRENT_USER Folder
If you want to store into HKEY_CLASSES_ROOT or HKEY_CLASSES_LOCALMACHINE
use Registry.LocalMachine like that
Syntax:
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Nameofthefolder\Subfolder");
Example:
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Settings\WinRegistry");
ShortCut Key - Windows + R press Enter
type regedit press OK , Choose Yes.
C# Code to store data into Registry Editor:-
Below code store data into HKEY_CURRENT_USER Folder
If you want to store into HKEY_CLASSES_ROOT or HKEY_CLASSES_LOCALMACHINE
use Registry.LocalMachine like that
Syntax:
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Nameofthefolder\Subfolder");
Example:
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Settings\WinRegistry");
key.SetValue("sname", txtName.Text.Trim());
key.SetValue("sno", txtSno.Text.Trim());
key.Close();
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment