//写log
private void WriteLog(string msg)
{
StringBuilder sb = new StringBuilder();
sb.Append(DateTime.Now + ":" + msg);
using (StreamWriter sw = new StreamWriter(Application.StartupPath + "\\log\\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", true))
{
sw.Write(sb);
sw.Flush();
sw.Close();
}
}