title: how to convert string to System.Net.IPAddress
body: <p>how can i convert string to System.Net,IPAddress in C#/.net 3.5</p>
  
  <p>i tried this but i got this error "Cannot convert type 'string' to 'System.Net.IPAddress'"</p>
  
  <pre><code> public void Form1_Load(object sender, EventArgs e)
      {
          IPHostEntry host;
          string localIP = "?";
          host = Dns.GetHostEntry(Dns.GetHostName());
          foreach (IPAddress ip in File.ReadAllLines("proxy.txt"))
          {
              if (ip.AddressFamily.ToString() == "InterNetwork")
              {
                  localIP = ip.ToString();
                  textBox1.Text = ip.ToString();
              }
          }
  
     }
  </code></pre>