You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.3 KiB

1 month ago
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<DateTime, BillInfoEveryDay> 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();
}
}
}