Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public bool TxtWeekLog(string text)
        {
            try
            {
                IOAid io = new IOAid();
                io.FilePath = path + "Log";
                if (io.CreateDirectory(io.FilePath))
                {
                    DateTime dtnow = DateTime.Now;
                    io.FileName = GetWeekOfYear().ToString();
                    io.FileFullPath = io.FilePath + "\\" + io.FileName;
                    io.CreateFile(io.FileFullPath, false);
                    string headDes = io.FileName + dtnow.Hour.ToString() + dtnow.Minute.ToString() + dtnow.Second.ToString() + dtnow.Millisecond.ToString();
                    io.AppendLineText(headDes + "······" + text);
                    zBool = true;
                }
            }
            catch { }

            return ZBool;
        }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        public bool TxtSeasonLog(string text)
        {
            try
            {
                IOAid io = new IOAid();
                io.FilePath = path + "Log";
                if (io.CreateDirectory(io.FilePath))
                {
                    DateTime dtnow = DateTime.Now;
                    switch (dtnow.Month)
                    {
                        case 1:
                            io.FileName = "spring";
                            break;
                        case 2:
                            io.FileName = "spring";
                            break;
                        case 3:
                            io.FileName = "spring";
                            break;
                        case 4:
                            io.FileName = "summer";
                            break;
                        case 5:
                            io.FileName = "summer";
                            break;
                        case 6:
                            io.FileName = "summer";
                            break;
                        case 7:
                            io.FileName = "autumn";
                            break;
                        case 8:
                            io.FileName = "autumn";
                            break;
                        case 9:
                            io.FileName = "autumn";
                            break;
                        case 10:
                            io.FileName = "winter";
                            break;
                        case 11:
                            io.FileName = "winter";
                            break;
                        case 12:
                            io.FileName = "winter";
                            break;
                    }
                    io.FileFullPath = io.FilePath + "\\" + io.FileName;
                    io.CreateFile(io.FileFullPath, false);
                    string headDes = io.FileName + dtnow.Hour.ToString() + dtnow.Minute.ToString() + dtnow.Second.ToString() + dtnow.Millisecond.ToString();
                    io.AppendLineText(headDes + "······" + text);
                    zBool = true;
                }
            }
            catch { }

            return ZBool;
        }