public bool IsIp(string ip)
{
bool b = true;
string[] lines = new string[4];
string s = ".";
lines = ip.Split(s.ToCharArray(), 4);//分割字符串
for (int i = 0; i < 4; i++)
{
if(Convert.ToInt32 (lines[i])>=255||Convert.ToInt32(lines[i])<0)
{
b = false;
return b;
}
}
return b;
}