Ever needed to convert a host name to an IP number? There is no direct routine available in Delphi for this but we can always code our way through
Here’s the code with error handling:
uses
Winsock;
…
// The IP number will be returned in string format in the sIP parameter
function HostToIP(sHost: string; var sIP: string): [...]
Merlin’s Delphi Forge