dotnet-Snippets.com
Snippets: 57 | Registered User: 27 | Visitors online: 2
Main Menu

Home
Random Snippet
FAQs
Contact Us
Imprint
RSS Feeds

Rss All languages
Rss C#
Rss VB.NET
Rss C++
Rss J#
Rss ASP.NET
Google Ads

Sri Lanka .NET 
                Forum Member
How to get properties from a local network cards

Author: Linoge
Programming Language: C# Rating:
not yet rated

Views: 244

Description:

How to get properties from a local network cards



C#
1
2
3
4
5
6
7
8
9
10
11
12
using System.Net.NetworkInformation;

NetworkInterface[] MyInterfaces = NetworkInterface.GetAllNetworkInterfaces();
            
foreach (NetworkInterface Networkcards in MyInterfaces)
{
Console.WriteLine(Networkcards.GetIPProperties().UnicastAddresses);
Console.WriteLine(Networkcards.GetIPProperties().GatewayAddresses);
Console.WriteLine(Networkcards.GetIPProperties().DnsAddresses);
Console.WriteLine(Networkcards.GetIPProperties().DhcpServerAddresses);
Console.WriteLine(Networkcards.GetIPProperties().WinsServersAddresses);
}

This Snippets could be interesting for you:

Poor Excellent
1 2 3 4 5 6 7 8 9 10
Sign in to vote for this snippet.

Comments:
(Please log in to wrtite an comment.)