How to Download a File From the Internet

Posted December 15th @ 4:14 pm by m3Rlin

You can always use some component. But if you are just going to download there is no need to do this or to use ActiveX controls. Windows has the function you need already declared in the UrlMon.dll. To download a file to a local disk just use this code:
!!Note: This function is not described in [...]

How to Resolve a Host Name

Posted December 15th @ 1:10 pm by m3Rlin

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): [...]

Next Entries »