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 WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (!File.Exists(textBox1.Text))
{
return;
}
StreamReader sr = new StreamReader(textBox1.Text,Encoding.GetEncoding("gb2312"));
String line;
while ((line = sr.ReadLine()) != null)
{
this.textBox2.Text = line;
}
sr.Close();
}
private void button2_Click(object sender, EventArgs e)
{
StreamWriter sw = new StreamWriter(textBox1.Text,true, Encoding.GetEncoding("GB2312"));
sw.WriteLine(textBox2.Text);
sw.Close();
}
}
}
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 WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (!File.Exists(textBox1.Text))
{
return;
}
StreamReader sr = new StreamReader(textBox1.Text,Encoding.GetEncoding("gb2312"));
String line;
while ((line = sr.ReadLine()) != null)
{
this.textBox2.Text = line;
}
sr.Close();
}
private void button2_Click(object sender, EventArgs e)
{
StreamWriter sw = new StreamWriter(textBox1.Text,true, Encoding.GetEncoding("GB2312"));
sw.WriteLine(textBox2.Text);
sw.Close();
}
}
}