I have a simple UDP server that works - I want to enter the data I'm getting to MySql.
When I setup the UDP server "enter" that data as a byte - then how do I convert it to string , and then cut it using delimiter ?
when i look at the CMD window - everything is working as it should, so the server is OK my problem is converting it to string so I can "cut" when I want - after "!
the message is Ok and I get it as I should ,
char delimiter = '!';
String CutData;
byte[] data = new byte[1024];
while (true)
{
data = newsock.Receive(ref sender);
CutData = data.ToString();
String[] ToDb = CutData.Split(delimiter);
Console.WriteLine(Encoding.ASCII.GetString(data, 0, data.Length));
}
Thanks,