byte[] DataBytes = new byte[Message.Length + ("<EOP>").Length + 1]; for (int x = 0; x < Message.Length; x++) { DataBytes[x] = Convert.ToByte(Message[x]); } DataBytes[Message.Length + 1] = Convert.ToByte('<'); DataBytes[Message.Length + 2] = Convert.ToByte('E'); DataBytes[Message.Length + 3] = Convert.ToByte('O'); DataBytes[Message.Length + 4] = Convert.ToByte('P'); DataBytes[Message.Length + 5] = Convert.ToByte('>'); clientSocket.Send(DataBytes);
using System.Text; byte[] bytes = Encoding.UTF32.GetBytes(iString);
string s = ... // Your string source here byte[] bytes = System.Text.Encoding.ASCII.GetBytes(s);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)