char[] c = new char[100]; c = x.ToCharArray(); server.SendTo(Encoding.ASCII.GetBytes(c), recv, SocketFlags.None, (EndPoint) list[i]);
where x is a non-empty string. When I try to run the code, it gives me the ArgumentOutOfRangeException (Specified argument was out of the range of valid values. Parameter name: size) error. What seems to be the problem? The only thing I modified (from the original working code) was that I replaced
Encoding.ASCII.GetBytes(Data) //the original code; Data was a char array
with
Encoding.ASCII.GetBytes(c)
Sorry if I didn't explain this any more clearly, but this is the best I can, given my C# knowledge and avoiding any unnecessary complications.
Thank you.

New Topic/Question
Reply




MultiQuote






|