I am trying some example Ping utilities as an asp.net application. The example I am trying to use is from http://www.java2s.com/Code/CSharp/Network/SimplePing.htm
I am new to C#, and believe I am missing something. The following portion of the code builds the message body of the packet to be sent. During compilation, it throws the error.
Buffer.BlockCopy(BitConverter.GetBytes((short)1), 0, packet.Message, 0, 2);
CS0117: 'bool' does not contain a definition for 'BlockCopy'
I cannot see why the compiler thinks I am passing any boolean value as an argument to BlockCopy. (short)1 makes an int16, GetBytes creates an array of bytes, and the other 4 arguments are standard. Am I missing something?
Found another line of code that does it as well, same function, same error
Buffer.BlockCopy(data, 0, packet.Message, 4, data.Length);
note: data is an Array of bytes, just as before