Advertisement
Guest User

Untitled

a guest
Jan 25th, 2014
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2. using Microsoft.Win32;
  3.  
  4. namespace registrykeysample
  5. {
  6.     class MainClass
  7.     {
  8.         public static void Main (string[] args)
  9.         {
  10.             var localMachine = Registry.LocalMachine;
  11.             Console.WriteLine (localMachine);
  12.             var test = localMachine.OpenSubKey("ThisIsATest", true);
  13.             Console.WriteLine("Test key: {0}", test);
  14.             if (test != null)
  15.                 test.Close();
  16.             localMachine.Close();
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement