Jump to content
toms

How can I programmatically connect to a VPN?

Recommended Posts

In windows, there's  "Network & Internet > VPN"  in the settings where I can connect to a specific VPN provider. How can I programmatically connect to a VPN using Delphi?

Share this post


Link to post

The Magenta TMagRas component will connect to any VPNs created by Windows, although I stopped testing it several years ago when the last public dial-up internet service in the UK closed, despite what the web page says, source code is now free from my download page. 

 

Angus

 

Share this post


Link to post
8 hours ago, Angus Robertson said:

The Magenta TMagRas component will connect to any VPNs created by Windows, although I stopped testing it several years ago when the last public dial-up internet service in the UK closed, despite what the web page says, source code is now free from my download page. 

 

Angus

 

Hi Angus,

 

there is no possibility to download the tMagRas component sources ... or I was not able to find that page 😉

Share this post


Link to post

Using the the Jedi (JVCL) unit JvRas32 you can connect to a any VPN created in Windows (i used it lot of years ago only with Microsft VPN), i don't know if it is actual working:

 

Quote

          JvRas321: TJvRas32;

          JvRas321 := TJvRas32.Create(self);

          //To Connect

          for i := 0 to JvRas321.PhoneBook.Count do

            begin
              if UpperCase(Trim(JvRas321.PhoneBook)) = UpperCase(YOUR_CONNECTION_NAME) then
                begin
                  JvRas321.Dial(i);

                  break;

               end;

 

           //To Disconnect

           JvRas321.HangUp;

 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×