How to Check if You are Connected to the Internet

Posted December 15th @ 4:17 pm by m3Rlin

Whenever you try to connect to connect to a Internet server while no Internet connection is present you can be almost certain an Access Violation will fire.
The only way around this is to check whether a connection is present or not. You can use the code below.

uses
Windows, SysUtils, Registry, WinSock, WinInet;

type
TConnectionType [...]

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

Next Entries »