获取网站IP

                string strwebsite = this.txtwebsite.Text.Trim();
                textBox1.Text = "";
                IPHostEntry dnstoip = new IPHostEntry();
                dnstoip = Dns.GetHostEntry(strwebsite);

                IPScaner ipScaner = new IPScaner();
                ipScaner.DataPath = Application.StartupPath + "/IpWry.Dat"; 

                for (int i = 0; i < dnstoip.AddressList.Length; i++)
                {
                    string strIp = dnstoip.AddressList[i].ToString();
                    ipScaner.IP = strIp;
                    textBox1.AppendText(strwebsite + "对应的IP地址是" + strIp + " [" + ipScaner.IPLocation() + "]\r\n");
                }

相关文章:

  • 2022-12-23
  • 2022-02-06
  • 2021-09-03
  • 2022-01-10
  • 2021-12-20
  • 2021-09-20
  • 2021-06-10
  • 2021-12-24
猜你喜欢
  • 2022-12-23
  • 2022-01-01
  • 2021-06-14
  • 2021-09-08
  • 2021-09-27
  • 2022-12-23
相关资源
相似解决方案