public void WriteFooter(FileCollector fileCollector, string[] fileTypes) { streamWriter.WriteLine(); streamWriter.WriteLine(",总实际行数,总注释行数,总空白行数,总行数"); CountInfo ci; string line; if (fileTypes.Length > 1) { foreach (string fileType in fileTypes) { ci = fileCollector.GetCountInfo(fileType); line = string.Format("{0},{1},{2},{3},{4}", ci.fileType, ci.effectiveCnt, ci.commentCnt, ci.blankCnt, ci.totalCnt); streamWriter.WriteLine(line); } } ci = fileCollector.GetTotalCountInfo(); line = string.Format("{0},{1},{2},{3},{4}", ci.fileType, ci.effectiveCnt, ci.commentCnt, ci.blankCnt, ci.totalCnt); streamWriter.WriteLine(line); }