;Autor: Flype ;http://www.purebasic.fr/english/viewtopic.php?p=145954#p145954 EnableExplicit Procedure.s GetIpAddr(ComputerName.s) Protected wsa.WSADATA Protected *host.HOSTENT If ComputerName If WSAStartup_((1<<8|1), wsa.WSADATA) = #NOERROR *host.HOSTENT = gethostbyname_(ComputerName) WSACleanup_() If *host ProcedureReturn PeekS(inet_ntoa_(PeekL(PeekL(*host\h_addr_list)))) EndIf EndIf EndIf EndProcedure Procedure.s GetMacAddr(IP.s) Protected n.l Protected i Protected MAC$ n.l = 6 Dim MacAddr.b(n) If SendARP_(inet_addr_(IP), 0, @MacAddr(0), @n) = #NO_ERROR For i = 0 To n - 2 MAC$ + RSet(Hex(MacAddr(i)&255),2,"0") + ":" Next ProcedureReturn MAC$ + RSet(Hex(MacAddr(i)&255),2,"0") EndIf EndProcedure Procedure.s GetHostName() Protected Size.l Protected Host.s Size.l = 32 Host.s = Space(Size) GetComputerName_(@Host, @Size) ProcedureReturn Host EndProcedure MessageRequester("","Physikalische Adresse (MAC): "+GetMacAddr(GetIpAddr(GetHostName())),0) ; IDE Options = PureBasic 5.31 (Windows - x64) ; CursorPosition = 2 ; Folding = - ; EnableUnicode ; EnableXP ; EnableUser ; EnableCompileCount = 0 ; EnableBuildCount = 0