Login into SonicWALL VPN through a .NET application

荒凉一梦 提交于 2019-12-10 18:12:20

问题


I am currently trying to access a SonicWALL VPN, inside of a .NET application. We have all the necessary credentials inside of our database, but I can't find a way to call the SonicWALL Global VPN inside a .NET application to start it.

  • Does SonicWALL have an API of any sort?
  • Or does .NET have a way to access the SonicWALL Global VPN?

I have seen Remote Access Services but not sure if this library can access SonicWALL Global VPNs or just Windows VPNs.


回答1:


The answer was simpler then the process I was trying.

You can launch sonicwall vpn client from the command line, and since you can do that obviously you can launch it through .NET using Process.start("path to client", "arguments")

Check out http://www.sonicwall.com/downloads/Global_VPN_Client_21_AdminGuide.pdf on launching sonicwall from the command line.




回答2:


First of all the Global VPN Client is unmanaged code, which means no access through .net.

But as OP mentioned you can use the CLI Approach with following options to perform a variety of Global VPN Client actions:

  • /E “Connection Name” – Enables the specific connection.

  • /D “Connection Name” – Disables the specific connection.

  • /Q - Quits a running an instance of the program. Ignored if program is not already running.

  • /A [filename] - Starts the program and sends all messages to the specified log file. If no log file is specified, the default file name is gvcauto.log. If the program is already running, this option is ignored.

  • /U “Username” - Username to pass to XAUTH. Must be used in conjunction with /E.

  • /P “Password” - Password to pass to XAUTH. Must be used in conjunction with /E.


C# Example

An Example Snippet for quiting the application in C# is:

Process.Start(@"C:\Program Files\SonicWALL\Global VPN Client\SWGVC.exe", "/Q");

By the way all these command line options also work for the Dell SonicWALL Global VPN Client Version.



来源:https://stackoverflow.com/questions/3731029/login-into-sonicwall-vpn-through-a-net-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!