>How do you get the same information provided by ‘WinIpCfg’ programmatically from within VFP.
the easiest way would be to run WINIPCFG and direct the output to a file, then read and parse the file. WINIPCFG takes an optional command line parameter /BATCH, that allows output to a file without echoing to a screen. For example
WINIPCFG /BATCH IPCFG.DAT
creates a file IPCFG.DAT in the current working directory. You could run WINIPCFG using the native VFP RUN command eg:
RUN /N0 WINIPCFG /BATCH IPCFG.DAT
or use the ShellExecute FFC class under VFP6, or the ShellExecute() or ShrellExecuteEx() or CreateProcess() API calls to do the same thing (my API_APPRUN class does this using Createprocess().)
Realize that WINIPCFG exists in Win9x only; under NT, IPCONFIG produces similar output (it exists under Win98 and Win2K as well, but not original Win95.)
You can also extract the same information using either Win32 API calls (a lot of them) or the WinSock ActiveX control. Rick Strahl's wwIPStuff class provides much of the functionality you'd want conveniently through a VFP class, and is available for download (there's also a commercial version available with more functionality.) Similar functionality is available from a number of third-party ActiveX controls as well.