Beispiel #1
0
        /// <summary>
        /// 记录栏目的访问日志
        /// </summary>
        /// <param name="IP"></param>
        /// <param name="UserName"></param>
        /// <param name="YongHuLeiXing"></param>
        /// <param name="LanMu"></param>
        public static void LogInsert(string IP, string UserName, string YongHuLeiXing, string LanMu)
        {
            try
            {
                TbLog tb = new TbLog();
                tb.ShiJian = DateTime.Now;
                tb.IP = IP;
                tb.UserName = UserName;
                tb.YongHuLeiXing = YongHuLeiXing;
                tb.LanMu = LanMu;

                string[] subIP = IP.Split('.');
                if (subIP.Length == 4)
                {
                    tb.DiQu = Stat.GetLocal(IP);
                }

                using (DataClasses1DataContext db = new DataClasses1DataContext())
                {
                    db.Log = Console.Out;
                    db.TbLog.InsertOnSubmit(tb);
                    db.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #2
0
 partial void DeleteTbLog(TbLog instance);
Beispiel #3
0
 partial void UpdateTbLog(TbLog instance);
Beispiel #4
0
 partial void InsertTbLog(TbLog instance);
Beispiel #5
0
        /// <summary>
        /// 栏目访问日志
        /// </summary>
        /// <param name="LanMu"></param>
        public static void LogInsertLanMu(string LanMu)
        {
            TbLog tb = new TbLog();
            tb.ShiJian = DateTime.Now;
            tb.LanMu = LanMu;

            using (DataClasses1DataContext db = new DataClasses1DataContext())
            {
                db.Log = Console.Out;
                db.TbLog.InsertOnSubmit(tb);
                db.SubmitChanges();
            }
        }