Hello, i need help with C# and .net.sockets

Hello, im creating a server for an MMORPG that was recently shut down, im up to the login server.

when the client connects i need to get some data from the packet I.E the OPCODE.

i dont know how to do this, but i can show you a code example of what im trying to achieve..

sock.Receive(data);
uint Opcode = 0;// trying to get it to = or data +6
//and the output in the uint should look like this 0x00000000
switch (Opcode)
{

case 0x00030000:
sendPacket(invalid_username);
break;

}

a regular typecast wont work, any suggestions?
[830 byte] By [UCDante] at [2007-11-20 11:43:02]
# 1 Re: Hello, i need help with C# and .net.sockets
Are you trying to cast data (a byte array) to Opcode (an unsigned int)?
RaleTheBlade at 2007-11-9 11:36:54 >