'===========================================================================
' Subject: Get IP Address                     Date: 03-15-02 (  :  )       
'  Author: Garrett R. Hylltun                 Code: Visual Design Script   
'  Origin: garrett@eyrisdev.com             Packet: VDS.ABC
'===========================================================================
REM _____________________________________________________ 
REM |\___________________________________________________/| 
REM | | | | 
REM | | SOURCE TITLE: Get IP Address - IP Address II | | 
REM | | ------------ | | 
REM | | SOURCE AUTHOR: Original source by ??? | | 
REM | | ------------- Modified by Garrett R. Hylltun | | 
REM | | | | 
REM | | DATE: 18 February, 2000 | | 
REM | | ---- | | 
REM | | REQUIREMENTS: VDS 3.x | | 
REM | | ------------ | | 
REM | | SOURCE STATUS: Public Domain | | 
REM | | ------------- | | 
REM | | SOURCE DESCRIPTION: | | 
REM | | ------------------ | | 
REM | | This example shows you how to get your local | | 
REM | | IP address. | | 
REM | |_________________________________________________| | 
REM |/___________________________________________________\| 
Title Ip Address II 
DIALOG CREATE,Ip Address II,-1,0,170,72 
DIALOG ADD,STYLE,STYLE1,,8,BR,BACKGROUND,FOREGROUND 
DIALOG ADD,LIST,IP,0,0,0,97 
DIALOG ADD,BUTTON,BUTTON1,4,2,164,24,Click To Find IP,DEFAULT 
DIALOG ADD,TEXT,TEXT1,38,2,58,14,Current IP: 
DIALOG ADD,TEXT,TEXT2,38,66,,,000.000.000.000,STYLE1 
DIALOG ADD,PROGRESS,PROGRESS1,32,-4,180,2 
DIALOG ADD,STATUS,STATUS1 
DIALOG SHOW :
evloop 
wait event 
goto @event() :
BUTTON1BUTTON Dialog Set,STATUS1,Checking for IP now...... 
REM --- |-------------------------------------------------| --- 
REM --- | We run a hidden console window and run the | --- 
REM --- | program "route.exe" which is included with | --- 
REM --- | windows. | --- 
REM --- |-------------------------------------------------| --- 
runh command.com /c route.exe 
print@path(%0)ip.txt,wait 
LIST 
LOADFILE,IP,@path(%0)ip.txt 
REM --- |-------------------------------------------------| --- 
REM --- | Load the output file into a list, and seek to | --- 
REM --- | index number 4. We will then parse the info at | --- 
REM --- | index. The 4th variable holds your IP. | --- 
REM --- |-------------------------------------------------| --- 
LIST 
SEEK,IP,4 %A = @ITEM(IP) 
OPTION FIELDSEP,@chr(32) 
PARSE "%B;%C;%D;%E;%F",%A dialog set,TEXT2,%E 
FILE DELETE,@path(%0)ip.txt 
Dialog Set,STATUS1,IP found. 
goto evloop :
CLOSE exit 

