There is probably an easy answer for this, but when I added DateTime.Now.ToString() to my fileName it adds an extra \\ for every \\ I have so C:\\Temp
DateTime.Now.ToString()
C:\\Temp
String fileName = String.Format(@"C:\Temp\data_{0}.txt",DateTime.Now.ToString("ddMMyyyyHHmmss"));
Output: C:\Temp\data_12042012214358.txt
C:\Temp\data_12042012214358.txt
or use
String fileName = String.Format(@"C:\Temp\data_{0}.txt", DateTime.Now.ToString("dd.MM.yyyy HH-mm-ss"));
Output: C:\Temp\data_12.04.2012 21-45-03.txt
C:\Temp\data_12.04.2012 21-45-03.txt