|
-
Nov 29th, 2002, 01:08 AM
#1
Thread Starter
Addicted Member
HEX values
Does anyone know how to convert integer values to hex values in C#. It is really easy to do in VB but I am not seeing a way in the documentation on how to do it in C#. I would really hate to have to write a class in VB just to use in C#.
Thanks
Jeremy
-
Nov 29th, 2002, 12:38 PM
#2
PowerPoster
Sure..
Code:
myNumber.ToString("X");
Could it get any easier??
-
Nov 29th, 2002, 05:26 PM
#3
Thread Starter
Addicted Member
-
Nov 30th, 2002, 08:03 AM
#4
-
Nov 30th, 2002, 08:01 PM
#5
Thread Starter
Addicted Member
The funny part is I know how to get from hex, I just couldn't get there. So here is the answer to your question.
PHP Code:
System.Windows.Forms.MessageBox.Show(Convert.ToInt16("ABC",16).ToString());
Jeremy
-
Dec 7th, 2002, 04:04 PM
#6
Lively Member
PHP Code:
System.Windows.Forms.MessageBox.Show(Convert.ToInt16("ABC",16).ToString());
I use this
PHP Code:
MyNumber = Int64.Parse(Value, Globalization.NumberStyles.AllowHexSpecifier)
What's the difference (better/worse)?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|