using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.IO; using System.Text; using Sog; namespace bill_statistics { public static partial class LogWrapper { public static void LogOnlineInfo() { FileStream fsFile = new FileStream("./bill_out_online.txt", FileMode.Create); StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8); string msg = "Date"; for (int i = 0; i < 24; i++) { msg += "\t" + i.ToString(); } fileWriter.WriteLine(msg); foreach (KeyValuePair pair in BillAlldays.Instance.m_billAllDays) { DateTime dateTime = pair.Key; BillInfoEveryDay info = pair.Value; //msg = dateTime.ToString(); msg = string.Format("{0}/{1}/{2}", dateTime.Year, dateTime.Month, dateTime.Day); for (int i = 0; i < 24; i++) { msg += "\t" + info.GetAvgUserNum(i); } fileWriter.WriteLine(msg); } fileWriter.Dispose(); fsFile.Dispose(); } } }