Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Afficher l’administrateur de registre

Exemple,d'utilisation,de,'PermissionSet'
{filelink=17853}

using System;
using Microsoft.Win32;
using System.Security.Permissions;
 
class ClasseRegistre
{
    static void Main(string[] args) {
 
        RegistryPermission permissionReg = new RegistryPermission(RegistryPermissionAccess.AllAccess,@"HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion");
        permissionReg.Demand();
 
        RegistryKey maClé = Registry.LocalMachine;
        maClé = maClé.OpenSubKey(@"SOFTWAREMicrosoftWindows NTCurrentVersion");
 
        Object oValue = maClé.GetValue("RegisteredOwner");
        Console.WriteLine("Administrateur: {0}", oValue.ToString());
 
    }
}

No comments yet.

Leave a Comment