一、实例窗体
二、运行结果图
三、实力源码
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace file_w_r
{
public partial class Form1 : Form
{
string[] str_tt = new string[3000]; //测试数组,存放第一次读取的内容
string[] str_tu = new string[3000]; //测试数组,存放第二次读取的内容
int kk;//数组控制变量
string path;
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if (saveFile_Dialog.ShowDialog() == DialogResult.OK)
{
path = saveFile_Dialog.FileName;
FileWriter(path, this.textBox1.Text);
}
}
private void button2_Click(object sender, EventArgs e)
{
if (openFile_Dialog.ShowDialog() == DialogRe