toms 29 Posted August 24, 2022 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
Fr0sT.Brutal 900 Posted August 25, 2022 AFAIK this API sits in the area of "dialing" so look for *Dial* WinAPI functions Share this post Link to post
toms 29 Posted January 10, 2023 The command line tool rasdial can be used. https://winaero.com/disconnect-vpn-in-windows-10/ Not sure if there's a windows api. Share this post Link to post
Angus Robertson 574 Posted January 10, 2023 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
microtronx 38 Posted January 10, 2023 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
Angus Robertson 574 Posted January 10, 2023 You need to request a download password on the TMagRas page, and then go to https://www.magsys.co.uk/delphi/dfiles/default.asp Sorry about password nonsense, it's to stop Google scanning my files and falsely black listing my site again. Angus 2 Share this post Link to post
DelphiUdIT 176 Posted January 15, 2023 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