I get an "invalid IPAdress exception" when I try to parse IPAddress entered in a textbox.
IPAddress addr = IPAddress.Parse(text1.ToString());
But my program works fine when I parse IPAddress as follows.
IPAddress addr = IPAddress.Parse("184.108.40.206");
Can anyone tell me why this is happening and how I can fix this problem?
Thanks in advance.
textbox.Tostring() is wrong because it return its type rather than Value by defualt.
You need to write this :
IPAddress address = IPAddress.Parse(textBox1.Text);
It'll work fine.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.
Would you like to participate?