Hello,
I have gather code and add myself for a vb net Project, I manage to connect from vb net 2013 with ovpn files and change my ip (from Free vpngate servers), I want to pass programmatically to ovpn files the username and password of pass protected from my vb net application and not from login.conf file. Here is my code
[/[code] Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If ComboBox1.Text = "" Then
MsgBox("Select server file from combobox", MsgBoxStyle.OkOnly, "error")
Else
openvpnProcess.StartInfo.CreateNoWindow = True
If CheckBox1.Checked = True Then
openvpnProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
Else
openvpnProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
End If
openvpnProcess.EnableRaisingEvents = True
openvpnProcess.StartInfo.Arguments = "--config " & Me.ComboBox1.SelectedItem & ""
'openvpnProcess.StartInfo.Arguments = Me.TextBox4.Text
openvpnProcess.StartInfo.UseShellExecute = False
openvpnProcess.StartInfo.RedirectStandardOutput = True
openvpnProcess.StartInfo.RedirectStandardInput = True
openvpnProcess.StartInfo.FileName = "C:\Program Files\OpenVPN\bin\openvpn.exe"
openvpnProcess.StartInfo.WorkingDirectory = "C:\Program Files\OpenVPN\config\"
openvpnProcess.Start()
code]
for unprotected servers Works but when comes to protected I cannot pass username and password from vb net eg. textbox.text, any help tutorial. Thank you