public CEnum2.EnumRESULT SetHeader(byte[] Packet) { if (Packet.Length < GetHeaderSize()) { return(CEnum2.EnumRESULT.HEADER_INVAILD); } DataType = ((char)Packet[0]).ToString(); ModuleID = Encoding.Default.GetString(Packet, 1, 4); TelegramNo = CUtil.ByteToShort(Packet[6], Packet[5]); DataLength = CUtil.ByteToShort(Packet[8], Packet[7]); return(CEnum2.EnumRESULT.OK); }