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 LogSnsFriend() { FileStream fsFile = new FileStream("./bill_out_snsfriend.txt", FileMode.Create); StreamWriter fileWriter = new StreamWriter(fsFile, Encoding.UTF8); string strMessage = "日期\t0天以上好友用户数量\t1天\t3天\t5天\t7天"; fileWriter.WriteLine(strMessage); foreach (KeyValuePair pair in BillAlldays.Instance.m_billAllDays) { var dateTime = pair.Key; BillInfoEveryDay info = pair.Value; strMessage = string.Format("{0}/{1}/{2}\t{3:0.00}\t{4:0.00}\t{5:0.00}\t{6:0.00}\t{7:0.00}", dateTime.Year, dateTime.Month, dateTime.Day, info.GetSnsFriendAvgCount(info.m_activeUser, 0), info.GetSnsFriendAvgCount(info.m_activeUser, 1), info.GetSnsFriendAvgCount(info.m_activeUser, 3), info.GetSnsFriendAvgCount(info.m_activeUser, 5), info.GetSnsFriendAvgCount(info.m_activeUser, 7) ); fileWriter.WriteLine(strMessage); } fileWriter.Dispose(); fsFile.Dispose(); } } }