I have some C# code:
private ushort SourcePort;
SourcePort = (ushort)IPAddress.NetworkToHostOrder(binaryReader.ReadInt16());
Since VB has no ushort type I can use the System.Uint16
Private SourcePort as System.Uint16
SourcePort = Convert.ToUInt16(IPAddress.NetworkToHostOrder(binaryReader.ReadInt16))
A value of -5386 converted to ushort in the above C# is 60151. Thats not larger than the System.Uint16 maximum value. When I convert the same -5386 using the above VB code I get an overflow exception telling me the value is either larger or smaller than what a Uint16 can handle. A Uint16 maximum is 65535
Anyone have some ideas?
private ushort SourcePort;
SourcePort = (ushort)IPAddress.NetworkToHostOrder(binaryReader.ReadInt16());
Since VB has no ushort type I can use the System.Uint16
Private SourcePort as System.Uint16
SourcePort = Convert.ToUInt16(IPAddress.NetworkToHostOrder(binaryReader.ReadInt16))
A value of -5386 converted to ushort in the above C# is 60151. Thats not larger than the System.Uint16 maximum value. When I convert the same -5386 using the above VB code I get an overflow exception telling me the value is either larger or smaller than what a Uint16 can handle. A Uint16 maximum is 65535
Anyone have some ideas?