Visual Basic 2010 - Array Size checking for a game -- Should I use TRY/CATCH or Should I use GetLength(0) + Delimiters?
Posted on 2010-11-17
Pretty simple question. I have a Client to Server application. Client sends a new application with user/password/etc, Server receives it seperated with a delimiter.
So let us say the delimiter is |
DataArray = Split(Data, "|")
Should I now call this:
If DataArray.GetLength(0) = 5 Then
Or should I do this
.. I want to prevent errors. I know of both but TRY/CATCH I haven't really used before, and I'm wondering if its practical here and won't be 'slow'. Application needs to be as fast as possible. Mainly to prevent someone from packet manipulation, sending one less variable to try to crash the server for example!
Also I'm wondering, what 'delimiter' can I use that someone cannot submit with a standard keyboard? Any ideas?