Click here to Skip to main content
15,883,889 members
Home / Discussions / C#
   

C#

 
GeneralRe: Implementing Serial number / Trial version Pin
BigAndy21-May-03 5:49
BigAndy21-May-03 5:49 
GeneralRe: Implementing Serial number / Trial version Pin
leppie21-May-03 13:09
leppie21-May-03 13:09 
Generalquestion about crystal reports 9 Pin
cruscal20-May-03 7:24
cruscal20-May-03 7:24 
GeneralRe: question about crystal reports 9 Pin
Mazdak20-May-03 8:52
Mazdak20-May-03 8:52 
GeneralRe: question about crystal reports 9 Pin
cruscal21-May-03 5:19
cruscal21-May-03 5:19 
GeneralPacket Capture Project Pin
firat kocak20-May-03 6:43
firat kocak20-May-03 6:43 
QuestionReading a Random Access file.. how to parse bytes? Pin
dazinith20-May-03 5:03
dazinith20-May-03 5:03 
AnswerRe: Reading a Random Access file.. how to parse bytes? Pin
firat kocak20-May-03 6:26
firat kocak20-May-03 6:26 
hi,

i couldn't see any function call as you made. There is no any ToInt32 function accepting a byte array as a parameter. But i can suggest you a few way to do this.

But first you should correct the array length of byData to the value 4 ( for int values there needs a 4-byte space ).

Way 1 -

unsafe public static int AddressOf(byte[] variable)
{
int ptrptr;

fixed(byte* ptr = variable)
{ptrptr = (int) ptr;}

return ptrptr;
}

int byDataAddr = AddressOf( byData );
int * iValue = ( int * ) byDataAddr;
int nInt = *iValue;

Way 2 -

int nInt = ( ( int ) byData[3] ) << 24 + ( ( int ) byData[2] ) << 16 +
( ( int ) byData[1] ) << 8 + ( int ) byData[0];

there is a way more but not so important. those above may help you, i hope

Doing something is better than doing nothing. So ... Move !
GeneralRe: Reading a Random Access file.. how to parse bytes? Pin
dazinith20-May-03 7:22
dazinith20-May-03 7:22 
GeneralRe: Reading a Random Access file.. how to parse bytes? Pin
dazinith20-May-03 7:43
dazinith20-May-03 7:43 
GeneralRe: Reading a Random Access file.. how to parse bytes? Pin
dazinith20-May-03 8:26
dazinith20-May-03 8:26 
GeneralRe: Reading a Random Access file.. how to parse bytes? Pin
leppie20-May-03 11:37
leppie20-May-03 11:37 
GeneralRe: Reading a Random Access file.. how to parse bytes? Pin
firat kocak20-May-03 20:42
firat kocak20-May-03 20:42 
AnswerRe: Reading a Random Access file.. how to parse bytes? Pin
Nathan Blomquist21-May-03 1:47
Nathan Blomquist21-May-03 1:47 
GeneralAutocompletion in DropDown ComboBox Pin
Braulio Dez20-May-03 0:22
Braulio Dez20-May-03 0:22 
GeneralRe: Autocompletion in DropDown ComboBox Pin
dazinith20-May-03 5:17
dazinith20-May-03 5:17 
GeneralRe: Autocompletion in DropDown ComboBox Pin
Braulio Dez20-May-03 5:34
Braulio Dez20-May-03 5:34 
GeneralRe: Autocompletion in DropDown ComboBox Pin
Braulio Dez20-May-03 5:44
Braulio Dez20-May-03 5:44 
GeneralRe: Autocompletion in DropDown ComboBox Pin
Richard Deeming21-May-03 8:20
mveRichard Deeming21-May-03 8:20 
GeneralRe: Pens &amp; Brushes Pin
Jon Newman20-May-03 4:30
Jon Newman20-May-03 4:30 
GeneralRe: Pens &amp; Brushes Pin
Jon Newman20-May-03 5:41
Jon Newman20-May-03 5:41 
GeneralRe: Pens &amp; Brushes Pin
Arun Bhalla20-May-03 18:58
Arun Bhalla20-May-03 18:58 
GeneralRe: Pens &amp; Brushes Pin
leppie20-May-03 8:08
leppie20-May-03 8:08 
GeneralRe: Pens &amp; Brushes Pin
Marc Clifton21-May-03 4:10
mvaMarc Clifton21-May-03 4:10 
GeneralRe: Pens &amp; Brushes Pin
leppie21-May-03 7:01
leppie21-May-03 7:01 

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.