using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace MIDE_Lite
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
}
private void fileToolStripMenuItem1_Click_1(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Text files(*.txt) | *.txt";
ofd.Title = "I'M EAT YOUR FILES!";
if (ofd.ShowDialog() == DialogResult.OK) ;
{
System.IO.StreamReader sr = new System.IO.StreamReader(ofd.FileName);
richTextBox1.Text = sr.ReadToEnd();
sr.Close();
}
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog svf = new SaveFileDialog();
svf.Filter = "Text files (*.txt)|*.txt";
svf.Title = "Ы";
if (svf.ShowDialog() == DialogResult.OK) ;
{
System.IO.StreamWriter sw = new System.IO.StreamWriter(svf.FileName);
sw.Write(richTextBox1.Text);
sw.Close();
}
}
private void fileToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
}
}
}
Как сделать функцию Save? Я думаю не стоит объяснять различия Save и Save As, просто не на западном, не на восточном интернете не видел написание функции.