All pastes #156995 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-09-01 06:20 UTC
rendered paste body
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;

namespace Manipulating_Files
{
    public partial class fclsManipulatingFiles : Form
    {
        public fclsManipulatingFiles()
        {
            InitializeComponent();
        }
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openDialog.CheckFileExists = true;
            openDialog.Title = "Select File";
            if(openDialog.ShowDialog() != DialogResult.Cancel)
            {
                FileStream fs = new FileStream(openDialog.FileName, FileMode.Open);
                StreamReader sr = new StreamReader(fs);
                richBox.Text = sr.ReadToEnd();
                sr.Close();
                fs.Close();
            }
        }
    }
}