Is there any possibility to get the status of the openvpn-gui, weather it is working or not?
I tried it with:
Process.GetProcessesByName("openvpn").Length
But this is always 0
, if there is no connection. I can click the EXE
, then I got a red symbol and an entry in taskmanager
, which shows not connected
, but the process status in C# remains at 0
.
This is quite bad, because I can't kill this process and can't open a new one. In my program I want to call a website, which is password protected, for this I need OpenVPN with its configurations. But I cannot start OpenVPN, if it is running, although it is not connected. So I want to check the status of this program, weather it is running or not.
- How can I readout the status of the
EXE
? - How can I reconnect with C#, if there is no connection?
I wrote a thread on openvpn forum (german) but they also do not know.
Windows netstat -r
or ipconfig /all
or /allcompartments
doesn't help.
I'm working with Visual C# 2010 Express and OpenVPN_2.3.2.0 on Win8.
PS: ovpn-red.png
:
This is the status, I want to readout with C#.