예제 #1
0
 //public static void alert(Page page, string msg)
 //{
 //    page.RegisterStartupScript("message", "<script language='javascript' defer>alert('" + msg + "');</script>");
 //}
 //写日志
 public static void setLog(string UserID, string UserName, string IP, string Content)
 {
     //    string path = HttpContext.Current.Server.MapPath("log/") + DateTime.Now.ToString("yyyyMMdd") + ".txt";
     //    if (!File.Exists(path))
     //    {
     //        using (StreamWriter sw = File.CreateText(path))
     //        {
     //            sw.WriteLine("[" + states + "] 用户名:" + User + " " + states + "时间:" + DateTime.Now.ToString() + " 用户IP:" + IP);
     //        }
     //    }
     //    else
     //    {
     //        using (StreamWriter wr = File.AppendText(path))
     //        {
     //            wr.WriteLine("[" + states + "] 用户名:" + User + " " + states + "时间:" + DateTime.Now.ToString() + " 用户IP:" + IP);
     //        }
     //    }
     dbConfig DB = new dbConfig();
     DB.InsertLog(UserID, UserName, IP, Content);
 }