[fpc-pascal] How to check if a network is available?

Bo Berglund bo.berglund at gmail.com
Fri Jun 18 16:02:52 CEST 2021

On Fri, 18 Jun 2021 15:00:18 +0200, Jean SUZINEAU via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:

>May be you can get some information with the "route" command .
>If you run "route print" in cmd command prompt, you can get information 
>on the different networks available.
>(I couldn't find the doc for Windows 10, but "route print" works on 
>Windows 10 Pro)
>May be you can run the command "route print " with TProcess and 
>parse the output ?

On command line (grep is available from a delphi):

C:\>route print | grep 10.117
File STDIN:         On-link    281         On-link    281         On-link    281         On-link    281         On-link    281

If I know beforehand which will be the IP address of the VPN network I could use

Bo Berglund
Developer in Sweden

More information about the fpc-pascal mailing list