Registry Values
-
I need this registry values to insert. "ValueName"=hex:fd,d5,72,d6,8b,6a,8a,6f,d5,33,95,fd" But i only know how to insert a string values. Help.
Vasildb
-
I need this registry values to insert. "ValueName"=hex:fd,d5,72,d6,8b,6a,8a,6f,d5,33,95,fd" But i only know how to insert a string values. Help.
Vasildb
Hello Vasildb, I think you have to convert your HEX string too int32. If you have .Net >1.1 you can use Int32.TryParse.
public Int32 HexToInt32(string hexString, Int32 default)
{
Int32 actvalue;
if(Int32.TryParse(hexString, System.Globalization.NumberStyles.HexNumber, CultureInfo.CurrentCulture, out actvalue))
{
return actvalue;
}
else
{
return default;
}
}//Call the method like this
Int32 actvalue = HexToInt32("fd", 0);
if(actvalue!=null)
{
YourRegKey.SetValue("Name", actvalue);
}Have not testet it, so I hope it works for you. All the best, Martin
-
I need this registry values to insert. "ValueName"=hex:fd,d5,72,d6,8b,6a,8a,6f,d5,33,95,fd" But i only know how to insert a string values. Help.
Vasildb
In .NET 1.x you could only read/write strings (REG_SZ entries) in the registry with the managed classes (RegistryKey). For other entry types (such as REG_DWORD) you had to use PInvoke. Since .NET 2.0 there is also support for the other entry types, through the new RegistryValueKind enum, and new methods in RegistryKey class such as RegistryKey.GetValueKind() :)
Luc Pattyn