System.Byte[] ba = {127,0,0,1}; System.Net.IPAddress ip = new System.Net.IPAddress(ba);The 2nd line in the code above throws the following error:
System.ArgumentException: addressThis is what the M$ docs say about one of the overloaded constructor for this class:
Initializes a new instance of the IPAddress class with the specified address and scope equal to 0. public IPAddress( byte[] address); Parameters address The byte array value of the IP address.And the funny thing is that no exceptions are listed in the M$ Docs for this constructor.
StringBuilder sbIP = new StringBuilder(15); sbIP.Append(baGeneralStatusPacket[258].ToString()); sbIP.Append('.'); sbIP.Append(baGeneralStatusPacket[259].ToString()); sbIP.Append('.'); sbIP.Append(baGeneralStatusPacket[260].ToString()); sbIP.Append('.'); sbIP.Append(baGeneralStatusPacket[261].ToString()); this._IPAddress = IPAddress.Parse(sbIP.ToString());Einar