using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Win32;
namespace Vichingo455_Settings.Utilities
{
internal class RegistryWorker
{
///
/// Sets a registry value on the local machine
///
/// Registry Key
/// Registry Value Name
/// Registry Value Data
/// Registry Value Type
///
public static int SetRegistryValueLocalMachineA(string RegistryKey,string RegistryValueName, string RegistryValueData, RegistryValueKind RegistryValueType)
{
try
{
RegistryKey rk = Registry.LocalMachine.CreateSubKey(RegistryKey);
rk.SetValue(RegistryValueName,RegistryValueData,RegistryValueType);
return 0;
}
catch
{
return -1;
}
}
public static int SetRegistryValueCurrentUserA(string RegistryKey, string RegistryValueName, string RegistryValueData, RegistryValueKind RegistryValueType)
{
try
{
RegistryKey rk = Registry.CurrentUser.CreateSubKey(RegistryKey);
rk.SetValue(RegistryValueName, RegistryValueData, RegistryValueType);
return 0;
}
catch
{
return -1;
}
}
}
}