To convert hex to Int64 I can use:
string hex = "413208A97245F5AE";
Int64 intFromHex = System.Convert.ToInt64(hex, 16);
//intFromHex = 4697826885160531374
How do I reverse this, and convert Int64 to hex?
Thanks,
Tim Sprout 3 10710
Tim,
You would use the ToString method on the Int64 (or Int32 method if you
want) and specify X or x for the format string (X gives you upper case
letters in the hex string, while x gives you lower case letters).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Tim Sprout" <tm**@ptialaska.netwrote in message
news:7D**********************************@microsof t.com...
To convert hex to Int64 I can use:
string hex = "413208A97245F5AE";
Int64 intFromHex = System.Convert.ToInt64(hex, 16); //intFromHex =
4697826885160531374
How do I reverse this, and convert Int64 to hex?
Thanks,
Tim Sprout
Thank you, Nicholas.
-Tim Sprout
>Nicholas Paldino wrote:
Tim,
You would use the ToString method on the Int64 (or Int32 method if you
want) and specify X or x for the format string (X gives you upper case
letters in the hex string, while x gives you lower case letters).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
>>Tim Sprout wrote:
To convert hex to Int64 I can use:
string hex = "413208A97245F5AE"; Int64 intFromHex = System.Convert.ToInt64(hex, 16); //intFromHex = 4697826885160531374
How do I reverse this, and convert Int64 to hex?
Thanks,
Tim Sprout
string hex = "413208A97245F5AE";
Int64 intFromHex = System.Convert.ToInt64(hex, 16);
// another solution...
string backToHex = Convert.ToString(intFromHex, 16);
Pedro Luna, Gye, Ecu This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Cindy Liu |
last post by:
Hi Everyone,
In .Net we have XmlSerializer to convert c# class to xml, or vice versa. Do
we have any APIs to convert c# class to XSD?
Thanks in advance,
Cindy
|
by: Ray Z |
last post by:
So far, I get the idea that if I want to use both the unmanaged and managed
memory, I can not avoid memory copy. But I DO need to avoid it. I get a idea
that maybe I could use "union" to convert...
|
by: Simon Devlin |
last post by:
Hi folks,
I've been bashing my head against this all afternoon and am now totally
baffled.
Given this (a simple routine to turn a ip address string into an decimal)
<snip>
Dim Parts(3) as...
|
by: harishashim |
last post by:
I have gone through necessary step and have been able to use a .Net
libraries (created using C#) in VB6. It run good untill I try to use
certain function in the library that is using Int64 type as...
|
by: Lau Lei Cheong |
last post by:
Hello,
I really need to use volatile System.Int64 for a .NET v1.1 program
in C#. But the compiler complains "a volatile field can not be of type
long". How to work around it? Or is there any...
|
by: cj |
last post by:
VB2003. I need a large positive integer. Which is larger int64 or double?
I see int64 also apparently is known as long and will hold
-9,223,372,036,854,775,808 through...
|
by: Calros Lo |
last post by:
Dear all:
I develop a programe that need when I get a string , such as "123" or
"ABC",if I get string "123" and the system will help me to create new
string "124" , if I get string "ABC" and the...
|
by: Allen |
last post by:
My C extension works wrong, and debug it, found that sizeof (INT64) =
4, not 8.
I compile on Windows XP platform.
Please tell me how to fix it to support INT64?
Thanks.
|
by: =?Utf-8?B?dmluY2VudA==?= |
last post by:
Is there any method to covert a pdf file into jpg file in c#?
Many thanks for your replying.
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |