S
Stuart Norris
Dear Readers,
I am attempting to define an array of IPAddress-es in C#.
I wish to have a array of address so I can try in order to connect to
them in a loop to handle unavailable hosts.
Todate since I do not know how to define an array of IPAddress-es. I
have been defining variable like:
IPAddress ipAddress1 = IPAddress.Parse( "10.1.1.1" );
IPAddress ipAddress2 = IPAddress.Parse( "11.1.1.1" );
Then define the end point using the hard coded name.
IPEndPoint remoteServerEndPoint = new IPEndPoint( ipAddress1, port );
How do I declare an array of IPAddress-es so I can loop around them
using an index counter?
I thought I could do IPAddress[] ipAddress = new IPAddress[2];
and then use ipAddress[0] = IPAddress.Parse( "10.1.1.1" );
This did not work.
What is the correct way to define an array of IPAdresses-es?
Thanks
Stuart
I am attempting to define an array of IPAddress-es in C#.
I wish to have a array of address so I can try in order to connect to
them in a loop to handle unavailable hosts.
Todate since I do not know how to define an array of IPAddress-es. I
have been defining variable like:
IPAddress ipAddress1 = IPAddress.Parse( "10.1.1.1" );
IPAddress ipAddress2 = IPAddress.Parse( "11.1.1.1" );
Then define the end point using the hard coded name.
IPEndPoint remoteServerEndPoint = new IPEndPoint( ipAddress1, port );
How do I declare an array of IPAddress-es so I can loop around them
using an index counter?
I thought I could do IPAddress[] ipAddress = new IPAddress[2];
and then use ipAddress[0] = IPAddress.Parse( "10.1.1.1" );
This did not work.
What is the correct way to define an array of IPAdresses-es?
Thanks
Stuart