Report information from NetworkInterface: name, description, id, type, speed, status : NetworkInterface « Network « C# / CSharp Tutorial

C# / CSharp Tutorial
1. Language Basics
2. Data Type
3. Operator
4. Statement
5. String
6. struct
7. Class
8. Operator Overload
9. delegate
10. Attribute
11. Data Structure
12. Assembly
13. Date Time
14. Development
15. File Directory Stream
16. Preprocessing Directives
17. Regular Expression
18. Generic
19. Reflection
20. Thread
21. I18N Internationalization
22. GUI Windows Forms
23. 2D
24. Design Patterns
25. Windows
26. XML
27. ADO.Net
28. Network
29. Directory Services
30. Security
31. unsafe
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
C# / CSharp Tutorial » Network » NetworkInterface 
28. 34. 1. Report information from NetworkInterface: name, description, id, type, speed, status
using System;
using System.Net.NetworkInformation;

class MainClass
{
    static void Main()
    {
        if (!NetworkInterface.GetIsNetworkAvailable())
           return;

        NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();

        foreach (NetworkInterface ni in interfaces)
        {
            
            Console.WriteLine("Interface Name: {0}", ni.Name);
            Console.WriteLine("    Description: {0}", ni.Description);
            Console.WriteLine("    ID: {0}", ni.Id);
            Console.WriteLine("    Type: {0}", ni.NetworkInterfaceType);
            Console.WriteLine("    Speed: {0}", ni.Speed);
            Console.WriteLine("    Status: {0}", ni.OperationalStatus);
        }
    }
}
Interface Name: Wireless Network Connection
    Description: Broadcom 802.11b/g WLAN - Packet Scheduler Miniport
    ID: {4FA13198-E7E5-4065-8395-EDC576EE1020}
    Type: Ethernet
    Speed: 54000000
    Status: Down
Interface Name: Local Area Connection
    Description: Realtek RTL8139 Family PCI Fast Ethernet NIC - Packet Scheduler Miniport
    ID: {0180EFAF-14BF-42AA-A274-6D8D766A0093}
    Type: Ethernet
    Speed: 100000000
    Status: Up
Interface Name: MS TCP Loopback interface
    Description: MS TCP Loopback interface
    ID: MS TCP Loopback interface
    Type: Loopback
    Speed: 10000000
    Status: Up
28. 34. NetworkInterface
28. 34. 1. Report information from NetworkInterface: name, description, id, type, speed, status
28. 34. 2. Report information from NetworkInterface: physical address
28. 34. 3. Report information from NetworkInterface: network statistics
28. 34. 4. Report information from NetworkInterface: IP address and DHCP Expires (DhcpLeaseLifetime)
w_ww__._j__av_a2_s_.__c_om_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.