How to get local IP adress

Author: (dammie)

Hello, is there way I can get ip adress of client computer that is running uniface form application via proc/function statement? Thanks for hints dammie


    • activate OS.commandout("ipconfig",$result)
    • You'll see a bunch of information, but the line you want to look for is "IPv4 Address."

    Author: ulrich-merkel (
  1. Is there any other way? -- for some security reason os command implementaion is not available for user of application...

    Author: dammie (
  2. There are some tiny JAVA programs documented: export it as "junnable JAR", and you can start it with: spawn "#javaw -jar my_jar_file"   Another option inside Uniface would be (with a temp creation of the <$componentname>.bat): entry do_launch params string p_formname : out endparams spawn "#<$componentname>.bat" ; ipconfig > TEST1.out fileload "<$componentname>.out", p_formname end ; do_launch HIH, Uli 

    Author: ulrich-merkel (
  3. $settings accesses registry settings --> HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces There are two or three keys here - you'll probably have to search each for 'DhcpServer' - if that sub key is present, the 'real' IP address for the PC will be in 'DhcpIPAddress'. Good luck. Knut

    Author: Knut (
  4. Hi Knut, a very nice solution without any implementations outside the uniface world. Think I should read a little more about the contents of the Windows Registy. Greetings from a very cold Frankfurt/Main morning (5° C), Uli

    Author: ulrich-merkel (
  5. My approach would be: 1. use ipconfig (in DOS box) to obtain your ip address (in my case 2. Search the HKEY_LOCAL_MACHINE in regedit for that value to come up with the keys that Knut mentions already from the top of his mind. 3. Read the Uniface documentation on how to craft something, using $setting. More background on the use of $setting to obtain registry values (click-able link): Uniface Reference > Proc: Functions > $setting > Addressing Registry Keys with $setting (Does anybody know how stable these registry keys are; do they change over time?)

    Author: Arjen van Vliet (
  6. Arjen van Vliet said ... 1. use ipconfig (in DOS box) to obtain your ip address (in my case ... 

    Is it that simple? Not really in my experience... The simple case scenario (IPv4): one network card = one IP and one gateway The worst case scenario (IPv4 or IPv6): +network cards = +IPs and +one or more gateways to deal with [it is becoming the normal scenario with Ethernet + WiFi + Bluetooth + VPN(s) + ...] After installing "Unix Utilities" (GnuWin32) into your Windows machine the command could be: C:\> ipconfig | grep IPv4 | awk "{print $NF}" This command could report one or more IP in the link-local range; these IP(s) could simply be discarded. The same approach should work for IPv6, remembering to discard those in the link-local range FE80::/10. C:\> ipconfig | grep IPv6 | awk "{print $NF}" A refined approach for IPv4 should consider in parallel with each IP(s) the default gateway associated to with command: C:\> ipconfig | grep Gateway | awk "{print $NF}" Only network card(s) associated with a real gateway are able to send net traffic to the outside world. Gateways AFAIK are automatic on IPv6. Which part of the "world" sits behind each gateway in a complex network, it could be difficult to recognize... Some of these rules should be applied also if Windows registry is inpected using $setting(). Hope it helps... Gianni

    Author: gianni (