This example uses GetAdaptersInfo API function: How to retrieve adapter information for the local computer (including MAC address) http://www.news2news.com/vfp/?example=347
This one uses Winsock API functions gethostname, gethostbyname: Winsock: retrieving the standard host name and IP address for the local machine http://www.news2news.com/vfp/?example=215
You can ping local computer using IcmpSendEcho API function to get its ip address: How to ping a remote site using ICMP API calls http://www.news2news.com/vfp/?example=486