private static String[] GetDialupConnections() { RAS.EntryName[] connections = RAS.GetRasEntries(); String[] result = new String[connections.Count()]; for (int i = 0; i < connections.Count(); ++i) { result[i] = connections[i].Name.ToLower(); } return(result); }
private static void DialInternet(String postfix, IEnsoService service) { try { if (!"".Equals(postfix)) { RAS.Dial(postfix); } } catch (Exception) { service.DisplayMessage(new EnsoMessage(CONNECT_ERROR)); } }
private static void HangupInternet(String postfix, IEnsoService service) { try { if (!"".Equals(postfix)) { IntPtr hConn = RAS.GetConnection(postfix); if (hConn != IntPtr.Zero) { RAS.HangUp(hConn); } } } catch (Exception) { service.DisplayMessage(new EnsoMessage(HANGUP_ERROR)); } }