|
|
Here’s a small snippet of code of how to find out which network cards are enabled and able to transmit data on your machine. Here’s the code.
Add a reference to System.Net.NetworkInformation
C#
var nics = NetworkInterface.GetAllNetworkInterfaces()
.Where(o => o.OperationalStatus == OperationalStatus.Up);
foreach (var item in nics)
{
Response.Write(item.Description + "<br />");
Response.Write(item.Name + "<br />");
Response.Write(item.Speed + "<br />");
Response.Write(item.NetworkInterfaceType + "<br /><br />");
}
VB.NET
Dim nics = NetworkInterface.GetAllNetworkInterfaces()_
.Where(Function(o) o.OperationalStatus = OperationalStatus.Up)
For Each item In nics
Response.Write(item.Description & "<br />")
Response.Write(item.Name & "<br />")
Response.Write(item.Speed & "<br />")
Response.Write(item.NetworkInterfaceType & "<br /><br />")
Next item
The output is below:
'Like' us on our FaceBook page if you find this blog useful. Thanks!
Did you like this post?
|
|
|
||
|
|
|
|
Save on Delicious |
|
|
subscribe via rss |
|
subscribe via e-mail |
|
|
print this post |
|
follow me on twitter |





comments
0 Responses to "Find Information about your Network Cards using C# or VB.NET"Post a Comment