My program uses IPHostEntry and DNS, i know i have to add System.Object, System.Net.IPHostEntry, System.Net.DNS to my project reference but i can not find it in the list.
After the System.IO.Log the next to follow is System. Management (no System.Object)
After the System.Net is System.Numerics (no System.Net.IPHostEntry or System.Net.DNS)
I am using .NET 4.0
What do i do to add the following reference and make it work?
i have the following codes
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.Windows.Forms;
public string LocalIPAddress()
{
IPHostEntry host;
string localIP = "";
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
localIP = ip.ToString();
break;
}
}
return localIP;
}