I have a RAS connection and I need disconnect to it using C#. How I do this? Currently I'm using dotRas library to handling ras connections.
How to disconnect from internet using C#?
1.8k views Asked by Jack At
2
There are 2 answers
0
On
Using the DotRas SDK, you'd just need to get the RasConnection instance you want and call HangUp().
using System.Linq;
using DotRas;
RasConnection conn = RasConnection.GetActiveConnections().Where(o => o.EntryName == "My Entry").FirstOrDefault();
if (conn != null)
{
conn.HangUp();
}
Hope that helps!
Based on this documentation you should just call the RasHangUp function.