5/10/2011

How to add a string value inside a registry in C#?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Permissions;
using Microsoft.Win32;
namespace Software_EditRegistry {

public partial class Form1 : Form
{

{
InitializeComponent();
}

{

public Form1()
private void button1_Click(object sender, EventArgs e)// Set String Value inide the registry.

}
}
}
Registry.SetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\", "C:\\Users\\XXX\\Desktop\\Source Code\\XXX.exe","WINXPSP2", RegistryValueKind.String);

read more : http://www.java2s.com/Tutorial/VB/0440__Windows/GetstringvaluefromRegistry.htm

No comments:

Post a Comment