开发者

C# Windows Service that connects to network through VPN

I have a Windows Service that must connect, via VPN, to the network in order to send emails. What I need to do (when I start the service) is check whether the VPN connection exist开发者_Python百科s, if not create it, and then connect to the network.

I was looking at DotRAS which looks ideal for doing all the work, however, it doesn't seem to provide a method for creating a new VPN connection.

So my question is, is there a way in which I can programmatically create a VPN connection?


Use a scriptable VPN client, and run it using Process.Start("path-to-your-script").

Depending on which client you use, you have different possibilities regarding monitoring the status of the VPN connection.

Here is an article where the Windows rasphone client is used in such a way.


My mistake, turns out DotRAS does have a method for creating new VPN connections :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜