Click here to Skip to main content
15,921,028 members
Home / Discussions / C#
   

C#

 
GeneralRe: Converting Strings to Hex Pin
Guinness4Strength3-Oct-05 4:55
Guinness4Strength3-Oct-05 4:55 
GeneralRe: Converting Strings to Hex Pin
Dan Neely3-Oct-05 6:53
Dan Neely3-Oct-05 6:53 
GeneralRe: Converting Strings to Hex Pin
Guinness4Strength3-Oct-05 8:44
Guinness4Strength3-Oct-05 8:44 
AnswerRe: Converting Strings to Hex Pin
Dario Solera3-Oct-05 7:06
Dario Solera3-Oct-05 7:06 
GeneralRe: Converting Strings to Hex Pin
Guinness4Strength3-Oct-05 8:43
Guinness4Strength3-Oct-05 8:43 
GeneralRe: Converting Strings to Hex Pin
Dario Solera3-Oct-05 9:08
Dario Solera3-Oct-05 9:08 
GeneralRe: Converting Strings to Hex Pin
Guinness4Strength3-Oct-05 9:12
Guinness4Strength3-Oct-05 9:12 
GeneralRe: Converting Strings to Hex Pin
Dario Solera4-Oct-05 5:25
Dario Solera4-Oct-05 5:25 
Very odd...

According to MSDN the "X" specifier prints the value in hex format.

The Format method can throw only 2 exceptions: ArgumentNullException (for the string argument) and FormatException (if the format specifiers are not valid).

MSDN tells the "X" specifier is valid only for integral number types, including (in my opinion) the decimal.

If the decimal is not supported (FormatException), the only way I know is to perform a 'manual' conversion to hex. Maybe there are some libs.

You should know how to convert a number to hex. If not, try this:
Perform a serie of divisions to 16, the rest is the hex digit. For example:
--> 315
315 / 16 = 19, rest 11 (B)
19 / 16 = 1, rest 3
1 / 16 = 0, rest 1
(continue until the result of the division becomes zero)
The hex value is 13B (reverse!!!)

___________________________________
Tozzi is right: Gaia is getting rid of us.
My Blog [ITA]

QuestionISerializable problems Pin
g00fyman3-Oct-05 3:53
g00fyman3-Oct-05 3:53 
AnswerRe: ISerializable problems Pin
Robert Rohde3-Oct-05 7:27
Robert Rohde3-Oct-05 7:27 
GeneralRe: ISerializable problems Pin
g00fyman3-Oct-05 13:47
g00fyman3-Oct-05 13:47 
GeneralRe: ISerializable problems Pin
Robert Rohde3-Oct-05 20:40
Robert Rohde3-Oct-05 20:40 
GeneralRe: ISerializable problems Pin
g00fyman3-Oct-05 20:59
g00fyman3-Oct-05 20:59 
QuestionPolar Graph in c#?? Pin
parvinder sehrawat3-Oct-05 3:30
parvinder sehrawat3-Oct-05 3:30 
AnswerRe: Polar Graph in c#?? Pin
Robert Rohde3-Oct-05 7:20
Robert Rohde3-Oct-05 7:20 
QuestionWriting code for Credit Card Reader in C# Pin
CharlyBrownson3-Oct-05 3:05
CharlyBrownson3-Oct-05 3:05 
AnswerRe: Writing code for Credit Card Reader in C# Pin
g00fyman3-Oct-05 4:09
g00fyman3-Oct-05 4:09 
GeneralRe: Writing code for Credit Card Reader in C# Pin
CharlyBrownson3-Oct-05 14:25
CharlyBrownson3-Oct-05 14:25 
GeneralRe: Writing code for Credit Card Reader in C# Pin
g00fyman3-Oct-05 15:44
g00fyman3-Oct-05 15:44 
QuestionC# and authenticating with LDAP Pin
ehuysamer3-Oct-05 2:49
ehuysamer3-Oct-05 2:49 
QuestionPassing Passwords ARGS Pin
har04mich3-Oct-05 2:30
har04mich3-Oct-05 2:30 
AnswerRe: Passing Passwords ARGS Pin
ehuysamer4-Oct-05 4:25
ehuysamer4-Oct-05 4:25 
QuestionGDI+ Problemo Pin
XeoN-Kc3-Oct-05 2:05
XeoN-Kc3-Oct-05 2:05 
AnswerRe: GDI+ Problemo Pin
leppie3-Oct-05 3:12
leppie3-Oct-05 3:12 
AnswerRe: GDI+ Problemo Pin
Andrew Kirillov3-Oct-05 3:44
Andrew Kirillov3-Oct-05 3:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.