I have a short code snippet in C++ and I need to have the same functionality in C#:
typedef enum {eD=0x0, eV=0x1, eVO=0x2, eVC=0x3} eIM;
#define htonl(x) ( ( ( ( x ) & 0x000000ff ) << 24 ) | \
( ( ( x ) & 0x0000ff00 ) << 8 ) | \
( ( ( x ) & 0x00ff0000 ) >> 8 ) | \
( ( ( x ) & 0xff000000 ) >> 24 ) )
int value = htonl(eV);
Unfortunately I'm no big programmer, so I need some help.