using ;
using System;
using ;
using ponentModel;
using ;
using ;
using ;
using ;
namespace my_notepad
{
public partial class Form1 : Form
{
public Form1()
{
ponent();
}
private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog = new OpenFileDialog();
= @"文本文件|*.txt|所有文件|*.*";
if (() == ) {
StreamReader sr = new StreamReader(, );
= ();
();
}
}
private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
= @"文本文件|*.txt";
if (() == ) {
StreamWriter sw = new StreamWriter(, false, ("gb2312"));
();
();
}
}
private void 退出xToolStripMenuItem_Click(object sender, EventArgs e)
{
();
}
private void 新建NToolStripMenuItem_Click(object sender, EventArgs e)
{
if ( && != "")
{
SaveFileDialog saveFileDialog2 = new SaveFileDialog();
DialogResult result =("文件"+Text+"内容已经改变\n\n你是否要保存文件?"
c#记事本 来自淘豆网m.daumloan.com转载请标明出处.