i want to write long hex to registry:
我要将长十六进制写入注册表:
[HKEY_CURRENT_USER\System\GameConfigStore]
"Win32_AutoGameModeDefaultProfile"=hex:02,00,01,00,00,00,c4,20,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00
"Win32_GameModeRelatedProcesses"=hex:01,00,01,00,01,00,67,00,61,00,6d,00,65,00,\
70,00,61,00,6e,00,65,00,6c,00,2e,00,65,00,78,00,65,00,00,00,c9,00,4e,95,67,\
77,b0,eb,1e,03,d8,f1,1e,03,1e,00,00,00,b0,eb,1e,03,1e,00,00,00,0f,00,00,00,\
2c,ea,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00
i know how to write hex but not long:
我知道如何写十六进制,但时间不长:
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile", "NetworkThrottlingIndex", 0xFFFFFFFF, RegistryValueKind.QWord);
how to write above long hex to registry in c#.
如何写以上长十六进制注册表在c#.
how to write above long hex to registry in c#.
如何在C#中将长十六进制以上的内容写入注册表。
更多回答
Try a byte[]
array maybe??
也许可以试试byte[]数组??
In your case, you want to write a QWord (64-bit integer) value. You can convert your hexadecimal value to a ulong and then use Registry.SetValue
在本例中,您希望编写一个QWord(64位整数)值。您可以将十六进制值转换为ulong,然后使用Registry.SetValue
can you give an example
你能举个例子吗?
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\.......", "SomeValue", yourByteArray, RegistryValueKind.Binary);
Registry.SetValue(@“HKEY_MACHINE\SOFTWARE\.......“,“SomeValue”,yourByteArray,RegistryValueKind.Binary);
thanks for example , but i mean how to convert that long hex to byte[]?
例如,谢谢,但我的意思是如何将那个长十六进制转换为byte[]?
我是一名优秀的程序员,十分优秀!