Sunday, 15 June 2014

c# - Get result after connecting to a VPN -



c# - Get result after connecting to a VPN -

i can connect existing vpn created next code.

string args = string.format("{0} {1} {2}", connvpnname, connusername, connpassword); var proc = new system.diagnostics.process { startinfo = new system.diagnostics.processstartinfo { filename = "c:\\windows\\system32\\rasdial.exe", arguments = args, useshellexecute = false, redirectstandardoutput = true, createnowindow = true } }; proc.start(); string output = ""; while (!proc.standardoutput.endofstream) { output += proc.standardoutput.readline(); txtoutput.text += proc.standardoutput.readline(); }

i need know if connection succeeded, wrong credentials used, vpn doesn't excist or if ip isn't online.

my first thought output commandprompt , search keywords "is connected". problem method users utilize multiple languages , keywords different.

can utilize other method accomplish this?

use dotras library wrapper around windows api. functions documented in msdn.

c# .net vpn

No comments:

Post a Comment