Well, I'll explain the problem to you: I have a system that reads the barcodes and in this system I need the txt file that is receiving the code do not receive duplicate / duplicate files, ie it can not receive the same code 2 times.
I'm having problems doing this without a database and because the windows platform where this system will run is quite old I having to program in VS2008.
Below is a portion of the code, where the file Count.txt is created by the system and the file receives the barcode and location of the collection:
if (!File.Exists(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase) + "\Contagem.txt"))
{
File.Create(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase) + "\Contagem.txt").Close();
}
StreamWriter sw = new StreamWriter(Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase) + "\Contagem.txt", true);
sw.WriteLine("|" + txtCodBarras.Text + "|" + txtLocal.Text.Substring(txtLocal.Text.Length - 3) + "|");
sw.Close();
sw.Dispose();