get computer IP problem

38 visualizaciones (últimos 30 días)
Yu Li
Yu Li el 6 de Nov. de 2018
Comentada: Stephan el 7 de Nov. de 2018
I use command [status,result] = system('arp -a'), to get the IP address of my computer. there are lots of IP in the variable 'result', such as dynamic, staticstic, etc.
meanwhile, the result are also found to be different at different day. for example, using the same command, the variable 'result' is different between yesterday and today.
just want know what paramters in the 'result' is fixed in the machine, which will not changed with time?
Thanks!
Yu
  2 comentarios
Steven Lord
Steven Lord el 7 de Nov. de 2018
What do you plan to do with this information? If we know your ultimate goal, we may be able to offer a way to achieve that goal without having to parse text returned by a system command.
Stephan
Stephan el 7 de Nov. de 2018

Iniciar sesión para comentar.

Respuesta aceptada

Stephan
Stephan el 6 de Nov. de 2018
Editada: Stephan el 6 de Nov. de 2018
Hi,
try:
[~, result] = system('ipconfig')
result:
Windows-IP-Konfiguration
Ethernet-Adapter LAN-Verbindung:
Verbindungsspezifisches DNS-Suffix: **.*********.de
IPv4-Adresse . . . . . . . . . . : **.***.**.**
Subnetzmaske . . . . . . . . . . : 255.255.255.0
Standardgateway . . . . . . . . . : **.***.**.*
for more detailed information use:
[~, result] = system('ipconfig -all')
The arp gives the adress Resolution protocoll - not your IP adress.
  3 comentarios
Walter Roberson
Walter Roberson el 7 de Nov. de 2018
IPv4 address is not likely to be unique for your machine.
Yu Li
Yu Li el 7 de Nov. de 2018
thank you

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by