Example (uses a textbox to enter the address, but you get the idea...
IPAddress OutAddr;
if (IPAddress.TryParse(textBox1.Text, out OutAddr) == false)
{
MessageBox.Show("Address is not valid!", "Error");
return;
}
else
{
MessageBox.Show(OutAddr.ToString());
}
Example (uses a textbox to enter the address, but you get the idea...
IPAddress OutAddr;
if (IPAddress.TryParse(textBox1.Text, out OutAddr) == false)
{
MessageBox.Show("Address is not valid!", "Error");
return;
}
else
{
MessageBox.Show(OutAddr.ToString());
}
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.