/// <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); } }
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> /// 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; } }
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); } }
private void frmHistorial_Load(object sender, EventArgs e) { Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL); List <string> list = new List <string>(); archivos.leer(out list); foreach (string i in list) { this.lstHistorial.Items.Add(i); } }
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]); } }
/// <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]); } }
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 item in datos) { lstHistorial.Items.Add(item); } }
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; } }
/// <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); } }
/// <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); } } }
private void frmHistorial_Load(object sender, EventArgs e) { Archivos.Texto archivo = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL); List <string> historial = new List <string>(); archivo.leer(out historial); foreach (string direccion in historial) { lstHistorial.Items.Add(direccion); } }
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); } } }
/// <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); } } }
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]); } }
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); } }
/// <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); }
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"); } }
/// <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"); } }
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); } }
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"); } }
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); } }
/// <summary> /// Lee linea por linea desde el archivo que se le pasa al constructor y los guarda en una lista auxiliar, /// luego se los pasa a la lista de lstHistorial, si leer retorna "false" detona un MessageBox /// </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> dat; if (archivos.leer(out dat)) { foreach (string i in dat) { lstHistorial.Items.Add(i); } } else { MessageBox.Show("(!) Error de lectura de historial"); } }
private void frmHistorial_Load(object sender, EventArgs e) { List <string> listHistory; Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL); if (archivos.leer(out listHistory)) { foreach (string url in listHistory) { lstHistorial.Items.Add(url); } } else { MessageBox.Show("No se pudo cargar el historial", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <summary> /// lee el historial y lo carga en el formulario /// </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; if (archivos.leer(out aux)) { foreach (String item in aux) { this.lstHistorial.Items.Add(item); } } else { MessageBox.Show("No se pudo abrir archivo"); } }
private void frmHistorial_Load(object sender, EventArgs e) { Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL); List <string> datos; try { archivos.leer(out datos); foreach (string item in datos) { lstHistorial.Items.Add(item); } } catch (Exception ex) { throw new Exception(ex.Message); } }
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; } else { // Si falla al leer muestra este mensaje. MessageBox.Show("Error al leer el historial.", "ERROR"); } }
/// <summary> /// Carga el formulario con las direcciones del archivo ARCHIVO_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> direcciones; try { if (archivos.leer(out direcciones)) { foreach (String item in direcciones) { this.lstHistorial.Items.Add(item); } } } catch (Exception) { } }
private void frmHistorial_Load(object sender, EventArgs e) { try { Archivos.Texto archivos = new Archivos.Texto(frmHistorial.ARCHIVO_HISTORIAL); List <string> auxListString = new List <string>(); archivos.leer(out auxListString); foreach (string item in auxListString) { this.lstHistorial.Items.Add(item); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
static void Main(string[] args) { /* Por lo que entiendo, para serializar se necesita que las clases tengan * acceso a los miembros. si tienen miembros privados, que estos tengan sus * propiedades publicas correspondientes. Y tambien tienen que tener * un constructor por defecto. */ Person p = new Person("nacho"); Person p1 = new Person("eze"); Person p2 = new Person("marta"); Family f = new Family(); f.lsPerson.Add(p); f.lsPerson.Add(p1); f.lsPerson.Add(p2); /* serializacion xml */ /* guardar */ bool b = false; try { Archivos.Xml <Family> objXml = new Archivos.Xml <Family>(); b = objXml.guardar("family.xml", f); } catch (Exception e) { Console.WriteLine("ERROR: " + e.Message); } Console.WriteLine("b vale: " + b); /* leer xml */ Console.WriteLine("\n\n"); Console.WriteLine("LEO EL ARCHIVO."); Family f2; try { Archivos.Xml <Family> auxLeer = new Archivos.Xml <Family>(); auxLeer.leer("Family.xml", out f2); } catch (Exception e) { Console.WriteLine("ERROR: " + e.Message); } /* ARCHIVOS txt */ /* guardar */ //Family f = new Family(); bool b2 = false; try { Archivos.Texto objTexto = new Archivos.Texto(); b2 = objTexto.guardar("Family.txt", f.ToString()); } catch (Exception e) { Console.WriteLine("ERROR: " + e.Message); } /* lectura */ string datos = ""; try { Archivos.Texto objTexto = new Archivos.Texto(); objTexto.leer("Family.txt", out datos); } catch (Exception e) { Console.WriteLine("ERROR: " + e.Message); } Console.WriteLine("Datos Leidos: "); Console.WriteLine(datos); Console.ReadKey(); }