How would you modify the following IF statement to create 3 additional files with different file name extensions in a C# application on a Windows platform using VS2005?
Posted on 2012-09-08
I am working on developing a C# application on a Windows platform using VS2005.
How would you modify the following IF statement to create 3 additional files with different file name extensions, based on the value of the variable ExportedFile:
if (flename == "\\UDL.METRICS.PALLINT1.PALLINT1")
DateTime time = DateTime.Now;
string format = "yyyy";
iYear = time.ToString(format);
ExportedFile = MyProjectDir + flename + "." + iYear + "." + DateTime.Now.ToString("MMddhhmmss") + ".ARD.OUT.XLS";
ExportedFile has a present value as follows:
I would like to create 3 additional files names in which the file names start out the same as the variable ExporteFile but the file name endings are as follows:
The files would contain no data and the files can be assigned to variable names
strFile1, strFile2 and strFile3.