Example #1
0
 private void frmHistorial_Load(object sender, EventArgs e)
 {
     Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
     this.listaHist = new List <string>();
     archivos.Leer(out listaHist);
     lstHistorial.DataSource = listaHist;
 }
        /// <summary>
        /// Descarga como texto la url ingresada y guarda la direccion en un archivo
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnIr_Click(object sender, EventArgs e)
        {
            try
            {
                this.archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);

                this.txtUrl.Text = this.txtUrl.Text.ToLower();

                if (!(this.txtUrl.Text.StartsWith("http://")))
                {
                    this.txtUrl.Text = "http://" + this.txtUrl.Text;
                }

                Uri         uri         = new Uri(this.txtUrl.Text);
                Descargador descargador = new Descargador(uri);
                descargador.EventoEnProgreso     += new DescargaEnProgreso(this.ProgresoDescarga);
                descargador.EventohtmlFinalizado += new DescargaCompleta(this.FinDescarga);

                Thread hilo = new Thread(descargador.IniciarDescarga);
                hilo.Start();

                this.archivos.guardar(this.txtUrl.Text);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #3
0
 /// <summary>
 /// Inicializa el navegador.
 /// </summary>
 /// <param name="sender">Objeto que lanzo el evento.</param>
 /// <param name="e">Argumentos pasados por el evento.</param>
 private void frmWebBrowser_Load(object sender, EventArgs e)
 {
     this.txtUrl.SelectionStart  = 0; //This keeps the text
     this.txtUrl.SelectionLength = 0; //from being highlighted
     this.txtUrl.ForeColor       = Color.Gray;
     this.txtUrl.Text            = frmWebBrowser.ESCRIBA_AQUI;
     archivo = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
 }
Example #4
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            this.CenterToScreen();
            Archivos.Texto archivos     = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  listaNombres = new List <string>();

            archivos.leer(out listaNombres);
            lstHistorial.DataSource = listaNombres;
        }
 /// <summary>
 /// Se encarga de cargar la lista luego de leer el archivo de texto.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void frmHistorial_Load(object sender, EventArgs e)
 {
     Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
     archivos.leer(out datos);
     foreach (string temp in this.datos)
     {
         lstHistorial.Items.Add(temp);
     }
 }
Example #6
0
        public static string Leer()
        {
            string datos;

            Archivos.Texto texto = new Archivos.Texto();
            // -texto.Leer(Environment.SpecialFolder.Desktop.ToString() + "\\ejemplo.txt", out datos);
            texto.Leer("Jornada.txt", out datos);
            return(datos);
        }
 private void frmHistorial_Load(object sender, EventArgs e)
 {
     Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
     List<string> archivoLeer;
     archivos.leer(out archivoLeer);
     foreach (string item in archivoLeer) 
     {
         this.lstHistorial.Items.Add(item);
     }
     
 }
Example #8
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);

            archivos.leer(this._listaURLs);

            for (int i = 0; i < this._listaURLs.Count; i++)
            {
                this.lstHistorial.Items.Add(this._listaURLs[i]);
            }
        }
Example #9
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos  = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  historial = new List <string>();

            archivos.Leer(out historial);
            foreach (string t in historial)
            {
                this.lstHistorial.Items.Add(t);
            }
        }
        /// <summary>
        /// Lee el archivo y, de no haber problemas, lo guarda en una lista de strings
        /// </summary>
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);

            List <string> historial;

            if (archivos.leer(out historial))
            {
                lstHistorial.DataSource = historial;
            }
        }
        /// <summary>
        /// Carga la lista del listBox con los datos leidos del archivo.
        /// </summary>
        /// <param name="sender">Objeto que lanzo le evento.</param>
        /// <param name="e">Argumentos pasados por el evento.</param>
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  lsString;

            archivos.leer(out lsString);
            for (int i = 0; i < lsString.Count; i++)
            {
                this.lstHistorial.Items.Add(lsString[i]);
            }
        }
Example #12
0
        /// <summary>
        /// Carga la lista de paginas visitadas
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  datos    = new List <string>();

            archivos.leer(out datos);

            foreach (string i in datos)
            {
                lstHistorial.Items.Add(i);
            }
        }
Example #13
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  listaHistorial;

            archivos.leer(out listaHistorial);

            foreach (string i in listaHistorial)
            {
                this.lstHistorial.Items.Add(i);
            }
        }
Example #14
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  historial;

            // leo el historial.
            if (archivos.leer(out historial))
            {
                // paso la lista de strings del historial directamente al lstHistorial.
                lstHistorial.DataSource = historial;
            }
        }
Example #15
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  historial;

            if (archivos.leer(out historial))
            {
                foreach (string paginaWeb in historial)
                {
                    this.lstHistorial.Items.Add(paginaWeb);
                }
            }
        }
Example #16
0
        /// <summary>
        /// Carga el archivo "historial.dat" y lo muestra por patalla.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos  = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  historial = new List <string>();

            if (archivos.leer(out historial))
            {
                foreach (string sitio in historial)
                {
                    lstHistorial.Items.Add(sitio);
                }
            }
        }
Example #17
0
        public void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos  = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  historial = new List <string>();

            archivos.Leer(out historial);
            lstHistorial.BeginUpdate();
            foreach (string aux in historial)
            {
                lstHistorial.Items.Add(aux);
            }
            lstHistorial.EndUpdate();
        }
Example #18
0
        /// <summary>
        /// Se obtendra una lista con las paginas desde el achivo de texto, esta lista sera mostrada en pantalla
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            List <string> paginas = new List <string>();

            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);

            archivos.leer(out paginas);

            foreach (string url in paginas)
            {
                lstHistorial.Items.Add(url);
            }
        }
 public bool agregarNuevaUrl(string param)
 {
     try
     {
         Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
         archivos.guardar(param);
         return(true);
     }
     catch (Exception e)
     {
         throw new Exception("Agregando nueva url error: " + e.Message);
     }
 }
Example #20
0
        /// <summary>
        /// Event method called when history form is loaded
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            lstHistorial.DoubleClick += lstHistorial_DoubleClick;

            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);

            if (archivos.leer(out lista))
            {
                foreach (string datos in lista)
                {
                    this.lstHistorial.Items.Add(datos);
                }
            }
        }
Example #21
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  lista    = new List <string>();

            lista.Add(ARCHIVO_HISTORIAL);
            archivos.leer(out lista);


            for (int i = 0; i < lista.Count; i++)
            {
                lstHistorial.Items.Add(lista[i]);
            }
        }
Example #22
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  datos    = new List <string>();

            try
            {
                archivos.leer(out datos);
                lstHistorial.DataSource = datos;
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Example #23
0
        /// <summary>
        /// Lee del archivo Jornada.txt los datos de una Jornada como texto.
        /// </summary>
        /// <returns>
        /// string con los datos del archivo.
        /// Si no puede leer lanzara una excepcion ArchivosException.
        /// </returns>
        public static string Leer()
        {
            string datos;

            try
            {
                Archivos.Texto objTexto = new Archivos.Texto();
                objTexto.leer("Jornada.txt", out datos);
            }
            catch (Exception e)
            {
                throw new ArchivosException(e);
            }
            return(datos);
        }
Example #24
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);

            List <string> historial;


            if (archivos.leer(out historial))
            {
                lstHistorial.DataSource = historial;
            }
            else
            {
                MessageBox.Show("Error no pudo leer el historial", "Error");
            }
        }
Example #25
0
 private void frmHistorial_Load(object sender, EventArgs e)
 {
     Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
     try
     {
         archivos.Leer(out listaPaginas);
         foreach (string s in listaPaginas)
         {
             this.lstHistorial.Items.Add(s);
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #26
0
        /// <summary>
        /// carga el historial
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  aux;

            try
            {
                if (archivos.leer(out aux))
                {
                    lstHistorial.DataSource = aux;
                }
            }
            catch (Exception)
            {
                MessageBox.Show("Error al cargar el historial");
            }
        }
Example #27
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivo = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);

            List <string> historial;

            if (archivo.leer(out historial) == false)
            {
                MessageBox.Show("Error al cargar archivo");
                this.Close();
            }

            foreach (string direccion in historial)
            {
                lstHistorial.Items.Add(direccion);
            }
        }
Example #28
0
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos  = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
            List <string>  historial = new List <string>();

            if (archivos.leer(out historial))
            {
                foreach (string auxUrl in historial)
                {
                    lstHistorial.Items.Add(auxUrl);
                }
            }
            else
            {
                MessageBox.Show("Ocurrio un error al intentar leer el archivo de historial");
            }
        }
Example #29
0
 private void frmHistorial_Load(object sender, EventArgs e)
 {
     try
     {
         Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);
         List <string>  datos;
         archivos.leer(out datos);
         foreach (string item in datos)
         {
             lstHistorial.Items.Add(item);
         }
     }
     catch (Exception exc)
     {
         throw exc;
     }
 }
        private void frmHistorial_Load(object sender, EventArgs e)
        {
            Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL);

            // Objetivo: levantar los datos del historial.
            List <string> datos;

            try
            {
                archivos.leer(out datos);
                this.lstHistorial.DataSource = datos;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }