示例#1
0
        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);
        }
示例#2
0
        public LogFileOutput(string outputFileName)
        {
            this.OutputFileName = outputFileName;

            if (File.Exists(OutputFileName))
            {
                Module_Main.FileAlreadyExists(OutputFileName);
                File.Delete(OutputFileName);
            }

            log = new StreamWriter(OutputFileName);
        }