using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace SelectDictionary
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (openFileDialog1.ShowDialog()==DialogResult.OK)
{
StreamReader Reader = new StreamReader(openFileDialog1.OpenFile());
txteditor.Text= File.ReadAllText(openFileDialog1.FileName);
char[] arr = txteditor.Text.ToCharArray();
System.Text.StringBuilder stt = new StringBuilder();
foreach (char c in arr)
{
if (c != ' ')
stt.Append(c);
if (c == ' ')
{
stt.Append(System.Environment.NewLine);
}
}
txteditor.Text = stt.ToString();
}
}
private void btnSave_Click(object sender, EventArgs e)
{
if (saveFileDialog1.ShowDialog()==DialogResult.OK)
{
System.IO.File.WriteAllText(saveFileDialog1.FileName,txteditor.Text) ;
}
}
}
}