JCL Help:GetIPAddress

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Returns the IP address of a host.


Pascal

 function GetIPAddress(const HostName: string): string;


Parameters

Parameters Description
const HostName: string The name of the host computer who's IP address you want. If an empty string is passed the function returns the IP address of the local computer.


Return Value

If the function succeeds it returns the IP address of the specified host in the dotted decimal notation. If the function fails it returns an empty string.


Description

GetIPAddress attempts to resolve a hostname to an IP address. If the function succeeds it returns the IP address in dotted decimal notation. You can call GetIPAddress with GetLocalComputerName or an empty string as the HostName parameter to get the IP address of the local computer. This function assumes IPv4 addresses and only returns one IP address, even if the specified host has more then one.


About

Unit

JclSysInfo


Donator

John C Molyneux


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page