一款去除TXT文本重复行的简单工具。 using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TXTTools
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void OpenFileboxBtn_Click(object sender, EventArgs e)
{
FileDialog fileDialog = new OpenFileDialog();
if (fileDialog.ShowDialog() == DialogResult.OK) {
FilePathTxtbox.Text = fileDialog.FileName;
}
}
private void RemoveRepeatLineBtn_Click(object sender, EventArgs e)
{
string filepath = FilePathTxtbox.Text;
var list = File.ReadAllLines(filepath).ToList().Distinct();
评论