1,488
社区成员
发帖
与我相关
我的任务
分享
Friend Class Form1
Inherits System.Windows.Forms.Form
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim theNetworkInterfaces() As System.Net.NetworkInformation.NetworkInterface = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
For Each currentInterface As System.Net.NetworkInformation.NetworkInterface In theNetworkInterfaces
If currentInterface.OperationalStatus = Net.NetworkInformation.OperationalStatus.Up And currentInterface.NetworkInterfaceType.ToString() = "Ethernet" Then
RichTextBox1.AppendText("MAC 地址 " & currentInterface.GetPhysicalAddress().ToString() & ControlChars.CrLf)
RichTextBox1.AppendText("描述 " & currentInterface.Description.ToString() & ControlChars.CrLf)
RichTextBox1.AppendText("名称 " & currentInterface.Name.ToString() & ControlChars.CrLf)
RichTextBox1.AppendText("速度 " & currentInterface.Speed.ToString() & ControlChars.CrLf)
RichTextBox1.AppendText("网络接口类型 " & currentInterface.NetworkInterfaceType.ToString() & ControlChars.CrLf)
RichTextBox1.AppendText("运行状态 " & currentInterface.OperationalStatus.ToString() & ControlChars.CrLf)
RichTextBox1.AppendText(ControlChars.CrLf)
End If
Next
End Sub
End Class