Skip to content

Instantly share code, notes, and snippets.

Created July 6, 2010 11:57
Show Gist options
  • Save anonymous/465288 to your computer and use it in GitHub Desktop.
Save anonymous/465288 to your computer and use it in GitHub Desktop.
using System;
using System.IO;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
if (dlg.ShowDialog() == DialogResult.OK)
{
textBox1.Text=dlg.FileName;
}
Textreader tr = new StreamReader(dlg.FileName);
while ((string line = tr.ReadLine()) != null) { textBox2 += line; textBox2 += "/n"; }
tr.Close();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment