I have an exe that already creates a csv file. If I save the exe in C:/EXE, then the cvs file automatically gets created in C:/EXE folder.
C# code uses StreamWriter to accomplish this:
using (TextWriter log = new StreamWriter(errorLog + errorBatchNumber.ToString("000") + ".csv", true))
{
if (errorCount == 0)
{
log.WriteLine("Error message");
}
log.WriteLine(link.StatusMessage);
log.Close();
}
What I need to add:
- A folder needs to be created first where the csv file will be saved.
- This folder will be created where the EXE was saved, in this example: C:/EXE
- After folder and cvs file was created, it needs to be zipped thru code. (But I need to accomplish first 1 and 2)
Any ideas?
Thanks in advance guys! 🙂
If you know the path where the EXE will be saved then
http://www.icsharpcode.net/opensource/sharpziplib/ or http://wiki.sharpdevelop.net/SharpZipLib_MainPage.ashx