IT rekvalifikace s garancí práce. Seniorní programátoři vydělávají až 160 000 Kč/měsíc a rekvalifikace je prvním krokem. Zjisti, jak na to!
Hledáme nové posily do ITnetwork týmu. Podívej se na volné pozice a přidej se do nejagilnější firmy na trhu - Více informací.

Registry

java

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;


namespace EsetConsole
{
    class Registr
    {
        RegistryKey klic;
        public RegistryKey GetRegistryKey(string keyPath)
        {
            RegistryKey localMachineRegistry
                = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine,
                                          Environment.Is64BitOperatingSystem
                                              ? RegistryView.Registry64
                                              : RegistryView.Registry32);

            return string.IsNullOrEmpty(keyPath)
                ? localMachineRegistry
                : localMachineRegistry.OpenSubKey(keyPath, true);
        }

        public void SetRegistryKey(string path, string type, string value)
        {
            //RegistryKey registry = GetRegistryKey(path);
            klic.SetValue(type, value);
          //  klic.Close();
        }


        public void SetRegistryBinKey(string path, string type, byte[] value)
        {
            //RegistryKey registry = GetRegistryKey(path);
          klic.SetValue(type, value); 
         //  klic.Close();          
        }

        public  void SetRegistry()
        {
            GetDataFromInternet pom = new GetDataFromInternet();
            string name = pom.ReadNameFromInternet();
            string pass = pom.ReadPassFromInternet();

           

            Decoder dec = new Decoder();
            byte[] CodePass = dec.Decode(pass);

            //RegistryKey registry = GetRegistryKey(keyPath);
          
            SetRegistryBinKey( keyPath, "Password", CodePass);

           // RegistryKey registry1 = GetRegistryKey(keyPath);
            SetRegistryKey( keyPath, "Username", name);
        
        }
        string keyPath;
        public Registr() {
             keyPath = @"SOFTWARE\ESET\ESET Security\CurrentVersion\Plugins\01000400\Profiles\@My Profile"; 
            klic = GetRegistryKey(keyPath);
        }
    }
}

Neformátovaný

Přidáno: 13.2.2015
Expirace: Neuvedeno

Avatar
Autor: Jirka Vaško
Aktivity