Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 private static void DialInternet(String postfix, IEnsoService service)
 {
     try
     {
         if (!"".Equals(postfix))
         {
             RAS.Dial(postfix);
         }
     }
     catch (Exception)
     {
         service.DisplayMessage(new EnsoMessage(CONNECT_ERROR));
     }
 }
Exemplo n.º 3
0
 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));
     }
 }