fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10.  
  11. namespace Memopad
  12. {
  13. public partial class Form1 : Form
  14. {
  15. public Form1()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void 保存ToolStripMenuItem_Click(object sender, EventArgs e)
  21. {
  22. SaveFileDialog dialog = new SaveFileDialog();
  23. dialog.Filter = "テキストファイル(*.txt)|*.txt|すべてのファイル(*.*)|*.*";
  24. //dialog.Title = "ファイルを保存する";
  25. if (dialog.ShowDialog() == DialogResult.OK)
  26. File.WriteAllText(dialog.FileName, textBox1.Text);
  27. }
  28.  
  29. private void 読み込みToolStripMenuItem_Click(object sender, EventArgs e)
  30. {
  31. OpenFileDialog dialog = new OpenFileDialog();
  32. dialog.Filter = "テキストファイル(*.txt)|*.txt|すべてのファイル(*.*)|*.*";
  33. //dialog.Title = "ファイルを読み込む";
  34. if (dialog.ShowDialog() == DialogResult.OK)
  35. textBox1.Text = File.ReadAllText(dialog.FileName);
  36. }
  37.  
  38. private void 終了ToolStripMenuItem_Click(object sender, EventArgs e)
  39. {
  40. Close();
  41. }
  42.  
  43. private void 元に戻すToolStripMenuItem_Click(object sender, EventArgs e)
  44. {
  45. textBox1.Undo();
  46. }
  47. }
  48. }
  49.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty