Answers

Question and Answer:

  Home  SilkTest

⟩ How can we get the IP address of a PC?

You can use the following

main

[ ] INTEGER iReturn

[ ] STRING sCmdLine = "ipconfig"

[ ] LIST OF STRING lsOutput

[ ] iReturn = SYS_Execute (sCmdLine , lsOutput)

[ ] listprint(lsOutput)

output is

[ ] Windows IP Configuration

[ ] Ethernet adapter Local Area Connection:

[ ] Connection-specific DNS Suffix . : abcd.xyz.net

[ ] IP Address. . . . . . . . . . . . : 1x.2xx.2xx.79

[ ] Subnet Mask . . . . . . . . . . . : 255.255.0.

[ ]Default Gateway . . . . . . . . . : 10.206.1.1

You need to do some trickery to parse and get the IP string..

 218 views

More Questions for you: