Note : this is not a question but a snippet(i dont prefer to post to snippet section as it is not much useful)

Form1.Designer.cs :

namespace GrabDeviceInfo
{
	partial class Form1
	{
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}

		#region Windows Form Designer generated code

		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.textBox1 = new System.Windows.Forms.TextBox();
			this.SuspendLayout();
			// 
			// textBox1
			// 
			this.textBox1.Location = new System.Drawing.Point(47, 46);
			this.textBox1.Multiline = true;
			this.textBox1.Name = "textBox1";
			this.textBox1.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
			this.textBox1.Size = new System.Drawing.Size(390, 400);
			this.textBox1.TabIndex = 0;
			// 
			// Form1
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			this.ClientSize = new System.Drawing.Size(503, 482);
			this.Controls.Add(this.textBox1);
			this.Name = "Form1";
			this.Text = "Form1";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.ResumeLayout(false);
			this.PerformLayout();

		}

		#endregion

		private System.Windows.Forms.TextBox textBox1;
	}
}

Form1.cs :

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
namespace GrabDeviceInfo
{
	public partial class Form1 : Form
	{
		public Form1()
		{
			InitializeComponent();
		}

		private void Form1_Load(object sender, EventArgs e)
		{
			StringBuilder sb = new StringBuilder();
			RegistryKey regkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows CE Services");
			string[] valnames = regkey.GetValueNames();

			int i = 0;

			foreach (string s in valnames)
			{

				string val = regkey.GetValue(valnames[i++]).ToString();

				 sb.Append(s + " : " + val + Environment.NewLine);

			}
                                                regkey.Close();
			textBox1.Text = sb.ToString();
		}
	}
}

if you want to read single value modify the form_load as follows :

private void Form1_Load(object sender, EventArgs e)
		{
			RegistryKey regkey = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows CE Services");
			textBox1.Text = regkey.GetValue("DeviceOemInfo").ToString();
			regkey.Close();
		}

the project is attacted to this post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.