Is it possible to check if access to a VPN protected server file location available? i.e that the user has connected VPN, if not to stop the code and issue a warning?
A quick and easy way would be to check for the existence of a known file. If there are no known files and you have write permissions, you could try to write a temporary file and if successful, delete it.
I have a similar situation, not with a VPN, but with a removable drive. I keep a file named "DoNotDelete.Me" on the root of the drive. If I can access that file, I know the drive is connected.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.