I am trying to write the data of a heartrate puls belt to a file. Everytime I start the programm it says "Access to the path denied".
The file is not "read-only". I also tried this from another question: File.SetAttributes(file, FileAttributes.Normal);
Debug.WriteLine(data[1]);
string path = @"C:\Users\...\DatenTest.txt";
using (var stream = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write))
{
var writer = new StreamWriter(stream, Encoding.UTF8);
writer.Write(data[1]);
}
return data[1];
Does anybody has an idea?