Home All Groups Group Topic Archive Search About

READING hex value in registry

Author
20 Feb 2006 9:23 AM
James
i've a DWORD hex value in the registry key.

i can read the key and write to event log, however it writes in "decimal"
format.

how can i ensure it is read as per hex format ?

Author
20 Feb 2006 10:48 AM
Armin Zingler
"James" <jkk***@hotmail.com> schrieb
> i've a DWORD hex value in the registry key.

A DWORD has a value, but it does not have a format, so it's neither Hex nor
decimal. Strings do have a format.

> i can read the key and write to event log, however it writes in
> "decimal" format.

value.ToString("X8")

converts to a string in hex format.

> how can i ensure it is read as per hex format ?

The value is read. The value has no format.


Armin
Author
20 Feb 2006 10:55 AM
Ken Tucker [MVP]
James,

        The integers.tostring("x") will convert the number to hexidecimal

Ken
--------------
Show quoteHide quote
"James" <jkk***@hotmail.com> wrote in message
news:OwFzc9fNGHA.3984@TK2MSFTNGP14.phx.gbl...
> i've a DWORD hex value in the registry key.
>
> i can read the key and write to event log, however it writes in "decimal"
> format.
>
> how can i ensure it is read as per hex format ?
>
>
>