【发布时间】:2012-06-18 20:47:46
【问题描述】:
任何人都知道如何获取网卡名称
当我做 ipconfig/all 我可以得到这个
Ethernet adapter XC99HT:
Connection-specific DNS Suffix . : xx.xx.com
Description . . . . . . . . . . . : HP NC382i DP Multifunction Gigabit Server
Adapter
Physical Address. . . . . . . . . : F4-CE-46-94-E8-B0
DHCP Enabled. . . . . . . . . . . : No
Autoconfiguration Enabled . . . . : Yes
IPv4 Address. . . . . . . . . . . : 177.77.153.48(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 177.77.153.1
DNS Servers . . . . . . . . . . . : 177.77.124.129
177.77.124.130
Primary WINS Server . . . . . . . : 177.77.124.129
Secondary WINS Server . . . . . . : 177.77.124.130
NetBIOS over Tcpip. . . . . . . . : Enabled
想要获得“HP NC382i DP 多功能千兆服务器 适配器”只需使用/传递以太网名称“XC99HT”
【问题讨论】:
-
您总是可以执行 ipconfig 命令,然后使用正则表达式读取输出,但我不打算为您编写代码 ;-)(我希望有人给您比这更好的答案)
标签: c# windows-server-2008-r2 ethernet nic