Beispiel #1
0
        void Cargar_Datos()
        {
            FileStream   stream = new FileStream("DatosBusqueda.txt", FileMode.Open, FileAccess.Read);
            StreamReader reader = new StreamReader(stream);

            while (reader.Peek() > -1)
            {
                Ordenar data = new Ordenar();
                data.URL1  = reader.ReadLine();
                data.Fecha = DateTime.Parse(reader.ReadLine());

                Lista.Add(data);
            }
            reader.Close();
        }
Beispiel #2
0
        private void butBuscar_Click(object sender, EventArgs e)
        {
            Ordenar orden    = new Ordenar();
            Regex   isSearch = new Regex("^¿?([\\wáéíóú]+\\s?)+\\??$");

            if (isSearch.IsMatch(comboBox1.Text))
            {
                ventanaGoogle.Navigate($" http://www.google.com/search?q={comboBox1.Text}");
                orden.URL1  = comboBox1.Text;
                orden.Fecha = DateTime.Now;
            }
            else
            {
                comboBox1.Text = NormalizarURL.NormalizeUrl(comboBox1.Text);
                ventanaGoogle.Navigate(comboBox1.Text);
                orden.URL1  = comboBox1.Text;
                orden.Fecha = DateTime.Now;
            }

            Lista.Add(orden);
            Guardar_Datos();
            Cargar_Datos_Combobox();
        }