I have a String Path to output a .ZIP file String path = @"C:\TEMP\test.zip";
and I am looking to five the file name a date stamp. Example, test_TodayDate.ZIP.
There's a way to achieve this?
Thanks
You can do:
string filePath = @"C:\TEMP\test.zip";
string finalPath = Path.Combine(Path.GetDirectoryName(filePath),
Path.GetFileNameWithoutExtension(filePath)
+ DateTime.Now.ToString("yyyyMMddHHmmss")
+ Path.GetExtension(filePath));