public bool OpenFile(string sOutputFilename) { string folderPath = sOutputFilename.Substring(0, sOutputFilename.LastIndexOf("\\")); if (Directory.Exists(folderPath)) { if (File.Exists(sOutputFilename)) { bool go = Module_Main.FileAlreadyExists(sOutputFilename); if (go) { File.Delete(sOutputFilename); } else { return(false); } } sw = new StreamWriter(sOutputFilename, true); } return(true); }
public LogFileOutput(string outputFileName) { this.OutputFileName = outputFileName; if (File.Exists(OutputFileName)) { Module_Main.FileAlreadyExists(OutputFileName); File.Delete(OutputFileName); } log = new StreamWriter(OutputFileName); }