public void GetErrorFile(string source, string errormessage)
{
string filename = "C:\\Error_" + DateTime.Now.ToString("dd-MM-yyyy") + ".txt";
if (File.Exists(filename))
{
using (StreamWriter writer = new StreamWriter(filename, true))
{
writer.WriteLine("Time: " + DateTime.Now);
writer.WriteLine("Source: " + source);
writer.WriteLine("Error: " + errormessage);
writer.WriteLine(" ");
}
}
else
{
StreamWriter writer = File.CreateText(filename);
writer.WriteLine("Time: " + DateTime.Now);
writer.WriteLine("Source: " + source);
writer.WriteLine("Error: " + errormessage);
writer.WriteLine(" ");
writer.Close();
}
Could not find a part of the path 'my path'.....