private void Log(string log) { using(StreamWriter sw = new StreamWriter(HttpContext.Server.MapPath("~/log.txt"),true)) { sw.WriteLine(string.Concat(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ": ", log)); sw.Close(); } }