Exemple #1
0
        /// <summary>
        /// 自动阅知
        /// </summary>
        /// <param name="resPath"></param>
        /// <param name="contents"></param>
        public void Read()
        {
            try
            {
                string s = "";
                if (DateTime.Now.Month.ToString().Length == 1)
                {
                    s = "0";//补0
                }
                string date = DateTime.Now.Year.ToString().Substring(2) + s + DateTime.Now.Month.ToString();

                string dirPath  = HttpRuntime.AppDomainAppPath + "Log\\AutoRead\\";
                string fileName = "Log" + date + ".txt";
                if (!File.Exists(dirPath))
                {
                    Directory.CreateDirectory(dirPath);
                }

                B_Circulate circulate = new B_Circulate("");
                int         i         = circulate.AutoRead();
                if (i > 0)
                {
                    string contents = "执行自动阅知 " + DateTime.Now.ToString() + "\r\n";
                    File.AppendAllText(dirPath + fileName, contents, Encoding.UTF8);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        /// <summary>
        /// 自动阅知
        /// </summary>
        /// <param name="resPath"></param>
        /// <param name="contents"></param>
        public void Read()
        {
            try
            {
                string s = "";
                if (DateTime.Now.Month.ToString().Length == 1)
                {
                    s = "0";//补0
                }
                string date = DateTime.Now.Year.ToString().Substring(2) + s + DateTime.Now.Month.ToString();

                string dirPath = HttpRuntime.AppDomainAppPath + "Log\\AutoRead\\";
                string fileName = "Log" + date + ".txt";
                if (!File.Exists(dirPath))
                {
                    Directory.CreateDirectory(dirPath);
                }

                B_Circulate circulate = new B_Circulate("");
                int i = circulate.AutoRead();
                if (i > 0)
                {
                    string contents = "执行自动阅知 " + DateTime.Now.ToString() + "\r\n";
                    File.AppendAllText(dirPath + fileName, contents, Encoding.UTF8);
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }