private string PackSlipMessage_temp(string message) { var resp = new StringBuilder(); resp.Append(message); //resp.Replace("\r\n", "\0"); //resp.Replace("\\", "\0x01"); //resp.Replace("`", "\0x02"); //resp.Replace("\n", "\0x03"); //resp.Append('\0'); resp.Append(CrcCalculator.CRC_8(Encoding.UTF8.GetBytes(resp.ToString()))); return(resp.ToString()); }
private string PackSlipMessage(string message) { var resp = new StringBuilder(); resp.Append(message); resp.Replace("\r\n", "\0"); resp.Replace("\\", "\0x01"); resp.Replace("`", "\0x02"); resp.Replace("\n", "\0x03"); resp.Append('\0'); resp.Append(CrcCalculator.CRC_8(Encoding.UTF8.GetBytes(resp.ToString()))); //Console.WriteLine("Pack message is:----------{0}",resp); return(resp.ToString()); }