Đỉnh NGUYỄN

life's a journey not a destination

Find Information about your Network Cards (C#)

Leave a comment


using System;
using System.Linq;
using System.Net.NetworkInformation;

namespace NetworkCardInfo
{
    class Program
    {
        static void Main(string[] args)
        {
            // Network Interface Cards
            var nics = NetworkInterface.GetAllNetworkInterfaces().Where(o => o.OperationalStatus == OperationalStatus.Up);

            foreach (var item in nics)
            {
                Console.WriteLine("Description: " + item.Description);
                Console.WriteLine("Name: " + item.Name);
                Console.WriteLine("Speed: " + item.Speed);
                Console.WriteLine("Type: " + item.NetworkInterfaceType);
                Console.WriteLine();
            }
        }
    }
}

Advertisements

Author: dinhnn

Senior software developer, a technical leader. You can be reached at via email to dinhnguyenngoc@gmail.com, via my blog at dinhnguyenngoc.wordpress.com, and on Twitter @dinhnguyenngoc.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s