Valhalla Legends Archive

Programming => General Programming => .NET Platform => Topic started by: BaDDBLooD on February 17, 2005, 11:47 PM

Title: Error
Post by: BaDDBLooD on February 17, 2005, 11:47 PM
Array.Copy(AddressToBytes(remoteEP.Address.Address), 0, connect, 4, 4);

Gives me the error:

'System.Net.IpAddress' is Obsolete: 'IPAddress.Address is Address Family Dependent, use Equals method for comparison.'

Thanks
Title: Re: Error
Post by: MyndFyre on February 18, 2005, 12:46 AM
Well you silly!  Just use the GetAddressBytes (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemnetipaddressclassgetaddressbytestopic.asp) method of the IPAddress class.  Then you have a byte array that you can use in the constructor.