This post shows a simple example how to read and update the name of the device - which is stored in the registry.
I've written a simple bit of code that looks like the following:
using Microsoft.Win32;
public partial class Form1 : FormThe form looks like the following:
{
private const string IDENTITY = @"HKEY_LOCAL_MACHINE\Ident";
private const string NAME = "Name";
public Form1()
{
InitializeComponent();
}
private void apply_Click(object sender, EventArgs e)
{
Registry.SetValue(IDENTITY, NAME, deviceName.Text);
}
private void Form1_Load(object sender, EventArgs e)
{
deviceName.Text = (string)Registry.GetValue(IDENTITY, NAME, "NAME");
}
}
Mobile app pre-change
This can also been seen from the Settings\System\About\Device ID applet:
Device name pre-change
Also this can be seen via the Windows CE Remote Registry Editor (CE Remote Tools):
Now we simply change the "MyDevice" to "NewDeviceName" and click the Apply button. Our change is propagated instantly if we go and check the settings applet again:
It's as simple as that!
No comments:
Post a Comment