Как создать ключ реестра в hex - C#
Формулировка задачи:
public static class A
{
public static void Start(string ii)
{
string regkeyfolder = @"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer";
string paramname = "bla-bla-bla";
byte[] paramvalue = null;
if (ii == "1")
{
paramvalue = new byte[] { 01, 00, 00, 00 };
using (RegistryKey key = Registry.CurrentUser.CreateSubKey(regkeyfolder))
{
key.SetValue(paramname, paramvalue);
}
}
if (ii == "2")
{
paramvalue = new byte[] { 30,00,00,00,fe,ff,ff,ff,02,00,00,00,03,00,00,00,3e,00,00,00,3d,\
00,00,00,00,00,00,00,e3,02,00,00,00,05,00,00,20,03,00,00,60,00,00,00,02,00,\
00,00};
using (RegistryKey key = Registry.CurrentUser.CreateSubKey(regkeyfolder))
{
key.SetValue(paramname, paramvalue);
}
}Решение задачи: «Как создать ключ реестра в hex - C#»
textual
Листинг программы
string regkeyfolder = @"SOFTWARE\Classes\Directory\background\shell\Z001AAA";
paramname = "MUIVerb";
paramvalue = "Открыть командную строку";
paramname = "Icon";
paramvalue_byte = new byte[] { 0x25, 0x00, 0x53, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x52, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x74, 0x00, 0x25, 0x00, 0x5c, 0x00, 0x73, 0x00, 0x79, 0x00, 0x73, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6d, 0x00, 0x33, 0x00, 0x32, 0x00, 0x5c, 0x00, 0x63, 0x00, 0x6d, 0x00, 0x64, 0x00, 0x2e, 0x00, 0x65, 0x00, 0x78, 0x00, 0x65, 0x00, 0x00, 0x00 };
using (RegistryKey key = Registry.LocalMachine.CreateSubKey(regkeyfolder)) { key.SetValue(paramname, paramvalue_byte); }