PC Review


Reply
Thread Tools Rate Thread

convert Int32 to array of bytes (2)

 
 
Jan
Guest
Posts: n/a
 
      22nd Aug 2003
How can I convert Int32 (4 bytes long) value to array of
bytes?
I need only 4 bytes in result.

example: long value 55695542 -->

arr(0) == &HB6
arr(1) == &HD8
arr(2) == &H51
arr(3) == &H03


Thank you

 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      22nd Aug 2003
"Jan" <(E-Mail Removed)> schrieb
> How can I convert Int32 (4 bytes long) value to array of
> bytes?
> I need only 4 bytes in result.
>
> example: long value 55695542 -->
>
> arr(0) == &HB6
> arr(1) == &HD8
> arr(2) == &H51
> arr(3) == &H03


Dim arr as byte()
arr = BitConverter.GetBytes(MyInt)


--
Armin

 
Reply With Quote
 
jan
Guest
Posts: n/a
 
      22nd Aug 2003

Thank you.


>-----Original Message-----
>"Jan" <(E-Mail Removed)> schrieb
>> How can I convert Int32 (4 bytes long) value to array

of
>> bytes?
>> I need only 4 bytes in result.
>>
>> example: long value 55695542 -->
>>
>> arr(0) == &HB6
>> arr(1) == &HD8
>> arr(2) == &H51
>> arr(3) == &H03

>
>Dim arr as byte()
>arr = BitConverter.GetBytes(MyInt)
>
>
>--
>Armin
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: String Array to Int32 Array Convert? Pavel Minaev Microsoft Dot NET Framework 0 14th May 2009 10:50 PM
Re: String Array to Int32 Array Convert? Jesse Houwing Microsoft Dot NET Framework 0 14th May 2009 09:14 PM
how to convert int32 to byte array mehafi Microsoft C# .NET 9 3rd Jun 2008 03:35 PM
How can I convert char to int (Int32) in multidimensional array? Allen Maki Microsoft VC .NET 2 26th Feb 2006 11:16 AM
How to Convert Byte Array to Int32 (Big-endian) Charles Law Microsoft VB .NET 14 24th Jan 2005 10:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:44 PM.