Okay. Officially solved, you will all laugh on me.
Instead of this:
FolderBrowserDialog fd = new FolderBrowserDialog();
fd.SelectedPath = @"C:\BEVONT\";
fd.ShowDialog();
string path = fd.SelectedPath;
foreach (string file in Directory.GetFiles(path))
{
string contents = File.ReadAllText(file);
RichTextBox richTextBox1 = new RichTextBox();
richTextBox1.Rtf = contents + Environment.NewLine;
string plainText = richTextBox1.Text;
File.AppendAllText(@"N:\Kártyaellenőr\Konvert\Convert_" + DateTime.Now.ToString("yyyyMMdd") + ".txt", contents);
}
I just deleted some lines, and it's working now. Shame on me for not trying this before:
FolderBrowserDialog fd = new FolderBrowserDialog();
fd.SelectedPath = @"C:\BEVONT\";
fd.ShowDialog();
string path = fd.SelectedPath;
foreach (string file in Directory.GetFiles(path))
{
string contents = File.ReadAllText(file);
File.AppendAllText(@"N:\Kártyaellenőr\Konvert\Convert_" + DateTime.Now.ToString("yyyyMMdd") + ".txt", contents);
}