Beispiel #1
0
        public void ExeBackUp()
        {
            DirectoryInfo dic = new DirectoryInfo(Path);

            FileInfo[] arrFi = dic.GetFiles("*.*");//获取指定目录下所有文件
            if (arrFi.Length > 0)
            {
                for (int i = 0; i < arrFi.Length; i++)
                {
                    string newFile = Path + "\\" + arrFi[i];
                    if (arrFi[i].Name.Contains("Response"))                  //解析
                    {
                        string fileTime = arrFi[i].LastWriteTime.ToString(); //时间                                                                      //解析内容
                        ReadXMLToDB.ReadResponseXMLToDB(newFile, fileTime, LineNo);
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 执行读取已经可以访问的地址下面的最新一笔报文信息
        /// </summary>
        internal void ExeLastestXML()
        {
            DirectoryInfo dic = new DirectoryInfo(Path);

            FileInfo[] arrFi = dic.GetFiles("*.*"); //获取指定目录下所有文件
            SortAsFileLastWriteTime(ref arrFi);     //所有文件通过创建时间排序
            string fileTime = string.Empty;
            string newFile  = string.Empty;

            if (arrFi.Length > 0)
            {
                for (int i = 0; i < arrFi.Length; i++)
                {
                    newFile = Path + "\\" + arrFi[i];
                    if (arrFi[i].Name.IndexOf("Response") > -1)
                    {
                        fileTime = arrFi[i].LastWriteTime.ToString();

                        break;
                    }
                }
            }
            ReadXMLToDB.ReadResponseXMLToDB(newFile, fileTime, LineNo);
        }