c#如何实现文件的分解及合并

2024-10-14 10:23:07

1、首先打开vs2013(其他版本也可以),在C#项目中选择 Windows窗体应用程序。 写上项目名字点创建。(本例用VS2013系统默认项目名,路径随意。)

c#如何实现文件的分解及合并

3、修改代码: public Form1() { InitializeComponent(); listBox1.AllowDrop = true; }

c#如何实现文件的分解及合并

5、添加合并文件操作,双击窗口中“合并文件”按钮。 private void button1_Click(object sender荑樊综鲶, EventArgs e) { string[] s =new string[ listBox1.Items.Count]; int i; for (i = 0; i < s.Length; i++) { s[i]= listBox1.Items[i] as string ; } string 合并文件名 = this.textBox1.Text.Trim(); 合并文件(s, 合并文件名); }

c#如何实现文件的分解及合并
猜你喜欢