Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.IO;
- using System.Windows.Forms;
- namespace TestOpenFileDialog
- {
- /// <summary>
- /// Description of MainForm.
- /// </summary>
- public partial class MainForm : Form
- {
- public MainForm()
- {
- //
- // The InitializeComponent() call is required for Windows Forms designer support.
- //
- InitializeComponent();
- //
- // TODO: Add constructor code after the InitializeComponent() call.
- //
- }
- void Button1Click(object sender, EventArgs e)
- {
- DialogResult d = openFileDialog1.ShowDialog();
- if (d == DialogResult.OK)
- {
- string filename = openFileDialog1.FileName;
- FileStream f = new FileStream(filename, FileMode.Open);
- StreamReader sr = new StreamReader(f);
- //richTextBox1.Rtf = sr.ReadToEnd();
- sr.Close();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment