000
11.11.2004, 16:05 Uhr
~knopper
Gast
|
Hallo,
Ich habe dieses Code Fragment:
byte[] buffer = new byte[m_totalLength]; int position = 0; und
.....
// now copy the internet control flags and fragmentation offset into the next 2 bytes Array.Copy (BitConverter.GetBytes (IPAddress.HostToNetworkOrder ((short) (m_icf.Offset / 8))), 0, buffer, position, 2); buffer[position] |= (byte) (m_icf.DontFragment ? 0x40 : 0x00); buffer[position] |= (byte) (m_icf.MoreFragments ? 0x20 : 0x00); position += 2;
....
Wobei m_icf.DontFragment usw. bool Werte sind.
Was ich nicht verstehe ist: " |=" und " 0x40 : 0x00 "
Warum 0x40 ?
Kann mir jemand das erklären oder sagen wo gibt es tuts oder Beispiele für bit Oper. unter C# !
Danke im voraus ! |