This commit is contained in:
ms
2021-07-01 08:39:14 +02:00
parent 1870307007
commit 67f2a10607
15 changed files with 247 additions and 52 deletions

View File

@@ -1,5 +1,6 @@
Imports System.Net
Imports System.Runtime.InteropServices
Imports Dhcp
Public Class DHCP
@@ -110,15 +111,29 @@ Public Class DHCP
ReDim DHCP_Clients(Client_Array.NumElements - 1)
For i = 0 To Client_Array.NumElements - 1
' pt = IntPtr.Zero '''keine Ahnung, nur ein Test, kann wieder weg
pt = Marshal.ReadIntPtr(Client_Array.Clients, j)
DHCP_Clients(i) = Marshal.PtrToStructure(pt, GetType(DHCP_CLIENT_INFO))
'DHCP_Clients(i) = Marshal.PtrToStructure(pt, GetType(DHCP_CLIENT_INFO))
pt = IntPtr.Zero
j = j + 4
'Form1.Label1.Text &= DHCP_Clients(i).ClientName & " - " & DHCP_Clients(i).ClientIpAddress & " - " & Scobe_C - ((DHCP_Clients(i).ClientIpAddress * -1) + d) & vbCrLf
Next i
' MsgBox("")
End Sub
Public Shared Function DHCP1(dhcps As String)
Dim dhcpsrv As DhcpServer = DhcpServer.Connect(dhcps)
Dim scope = dhcpsrv.Scopes.First()
Dim activeClients = scope.Clients '.Where(Function(c) c.AddressState = DhcpServerClientAddressStates.Active)
Return activeClients
End Function
Friend Shared Function StringIPAddressToUInt32(Address As String) As UInteger