Xbasic
api_getPublicIPAddress Function
Syntax
IP_Address as C = api_getPublicIPAddress()
Description
Returns the public IP address for the machine.
Discussion
The api_getPublicIPAddress() function checks and returns the public-facing IP address of the computer where the code is executed.
Example
dim ip as c ip = api_getPublicIPAddress() ? ip = "203.0.113.1"
This function relies on external services to determine the public IP. It may fail if the machine is behind a firewall or proxy with no outbound access to the internet. Use with caution in environments where privacy or security is a concern.
See Also