Created
May 14, 2017 03:29
-
-
Save RicottiDev/c51f355b7753b62ad38660445b5c4912 to your computer and use it in GitHub Desktop.
Modificar Registro de Windows desde C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.Win32; | |
namespace Registro | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string userRoot = "HKEY_CURRENT_USER"; | |
string subkey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; | |
string keyName = userRoot + "\\" + subkey; | |
Console.WriteLine("1- Mostrar archivos ocultos"); | |
Console.WriteLine("2- Ocultar archivos ocultos"); | |
ConsoleKeyInfo reg = Console.ReadKey(); | |
if (reg.Key == ConsoleKey.D1) | |
{ | |
Registry.SetValue(keyName, "Hidden", 1, RegistryValueKind.QWord); | |
} | |
else | |
{ | |
Registry.SetValue(keyName, "Hidden", 2, RegistryValueKind.QWord); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment