NetworkInterface
クラスは、より具体的にはあなたにいくつかの使用(、GetAllNetworkInterfaces
方法でなければなりません。例をリンクMSDNの種類を取得する方法を示しページ、アドレス、動作ステータス、および他の上に示されていますすべてのネットワークインターフェイスに関する情報
MSDNの例の縮小版:?ネットワーク・インタフェースは、3G/EDGE/GPRSであれば、私が接続しようとした
public static void ShowNetworkInterfaces()
{
IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
Console.WriteLine("Interface information for {0}.{1} ",
computerProperties.HostName, computerProperties.DomainName);
if (nics == null || nics.Length < 1)
{
Console.WriteLine(" No network interfaces found.");
return;
}
Console.WriteLine(" Number of interfaces .................... : {0}", nics.Length);
foreach (NetworkInterface adapter in nics)
{
IPInterfaceProperties properties = adapter.GetIPProperties();
Console.WriteLine();
Console.WriteLine(adapter.Description);
Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,'='));
Console.WriteLine(" Interface type .......................... : {0}", adapter.NetworkInterfaceType);
Console.WriteLine(" Physical Address ........................ : {0}",
adapter.GetPhysicalAddress().ToString());
Console.WriteLine(" Operational status ...................... : {0}",
adapter.OperationalStatus);
Console.WriteLine();
}
}
OKは、これらの特性に基づいて、どのように伝えることができます3GモデムをPCに接続すると、NetworkInterfaceTypeは「Ppp」になります。これは、モバイルコンnection。 –