Hi,
I'm not sure of you level of C# experience so I will try and explain this in basic terms, I hope I'm not patronising you.
Your syntax isn't quite right. On the line where you have:
//display the IP adress
NetworkInterface networkInterface = NetworkInterface.GetAllNetworkInterfaces()[0];
The square brackets are in the wrong place, it should be:
//display the IP adress
NetworkInterface [] networkInterface = NetworkInterface.GetAllNetworkInterfaces();
This will declare an array of NetworkInterface objects, which will be filled with the result of the function call.
This will make you while loop condition wrong, and everywhere else you use the networkInterface variable, because now networkInterface is now an array rather than a single item.
So this should give you a good start
while (networkInterface[0].IPAddress.ToString().Equals("0.0.0.0"))
{
networkInterface = NetworkInterface.GetAllNetworkInterfaces();
Debug.Print("Meu IP:" + networkInterface[0].IPAddress.ToString());
Thread.Sleep(2000);
}
Debug.Print("Meu IP:" + networkInterface[0].IPAddress.ToString());
I have't tested any of this, because I was a cheep skate and didn't get the Ethernet socket, but if there is any problems I'll look at them as soon as I can.