20-08-23, 09:53 PM
وعليكم السلام ورحمة الله
جرب الكود التالي
جرب الكود التالي
كود :
Imports System
Imports System.Net
Public Class Form1
Public Sub New()
InitializeComponent()
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
' Get the list of connected devices
Dim devices As NetworkInterfaceCollection = NetworkInterface.GetAllNetworkInterfaces()
' Iterate through the list of devices
Dim i As Integer
For i = 0 To devices.Count - 1
' Display the name and IP address of each device
Label1.Text = Label1.Text & devices(i).Name & " - " & devices(i).IPAddress & vbCrLf
Next
End Sub
End Class