Hi,
Try this:
Imports System.IO
Imports System.Diagnostics
Public Class OpenVPNConnection
Public Sub TryConnect(UserID As String, UserPassword As String, LoginFileName As String, ServerFileName As String)
For Each NewVPNProcess As Process In Process.GetProcesses
If NewVPNProcess.ProcessName.Contains("OpenVPN") Then
NewVPNProcess.Kill()
End If
Next
File.WriteAllText(LoginFileName, UserID & vbNewLine & UserPassword)
Using processInfo As New Process
With processInfo.StartInfo
.FileName = "openvpn-gui"
.Arguments = "--connect " & ServerFileName & " --auth-user-pass " & LoginFileName
.WindowStyle = ProcessWindowStyle.Hidden
End With
processInfo.Start()
End Using
End Sub
End Class
Here you can download exact source code done in VB.Net 2010 for OpenVPN Gui:
http://www.symbianize.com/showthread.php?t=471015
Find multiple source codes you are looking for from this URL:
https://community.openvpn.net/openvpn/wiki/RelatedProjects
Some Youtube videos for step's to make openVPN client GUI with visual basic:
https://www.youtube.com/watch?v=ilvN17e5wdo
https://www.youtube.com/watch?v=81DFRYHnitU
Hope it helps.
Regards,
Shashikant Gurav
shashikantgurav22@gmail.com