PDA

View Full Version : سوال: دست رسی به کلید های ریجیستر ویدوز



afshines
یک شنبه 13 آذر 1390, 10:43 صبح
چطور به آی دی دیجیتالی ریجیستر ویندوزهای مختلف دست رسی پیدا کنم کلا دسترسی به ریجیستر چطوری یه مثال می خواستم

Mohammad_chz
یک شنبه 13 آذر 1390, 12:35 عصر
این مثال از MSDN هست. حتما به دردتون میخوره!
اگه خودتون تو MSDN بگردید مطالب بیشتری پیدا می کنید.


using System;using Microsoft.Win32;class Reg { public static void Main() { // Create a RegistryKey, which will access the HKEY_USERS // key in the registry of this machine. RegistryKey rk = Registry.Users; // Print out the keys. PrintKeys(rk); } static void PrintKeys(RegistryKey rkey) { // Retrieve all the subkeys for the specified key. String [] names = rkey.GetSubKeyNames(); int icount = 0; Console.WriteLine("Subkeys of " + rkey.Name); Console.WriteLine("-----------------------------------------------"); // Print the contents of the array to the console. foreach (String s in names) { Console.WriteLine(s); // The following code puts a limit on the number // of keys displayed. Comment it out to print the // complete list. icount++; if (icount >= 10) break; } }}