예제 #1
0
        private void ShowFileList()
        {
            List <DeTailFile> s = new List <DeTailFile>();

            QueryFiles.FindFile("E:\\客户端\\QuantShell", s);
            this.DetailFileList = s;
        }
예제 #2
0
        public static void CreatFileInfoXml()   //创建客户端文件信息xml
        {
            XDocument addList = XDocument.Load(".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar
                                               + "Resource" + Path.DirectorySeparatorChar + "Xml" + Path.DirectorySeparatorChar + "FilterFile.xml");
            var text = from v in addList.Descendants("fileInfo")
                       select v;

            foreach (var node in text)
            {
                FilterFile.Add(node.Attribute("file_name").Value);
            }
            QueryFiles.FindFile(SrcDirectory + Path.DirectorySeparatorChar, FilePath, FilterFile);
            string s = SrcDirectory.Substring(SrcDirectory.LastIndexOf(Path.DirectorySeparatorChar));

            foreach (String SrcFilePath in FilePath)
            {
                //拼接xml里文件名的相对路径
                FilesInfo.Add(s + SrcFilePath.Replace(SrcDirectory, ""), QueryFiles.GetMD5HashFromFile(SrcFilePath));
            }
            CreatXml.CreateXML(FilesInfo, TempFile + Path.DirectorySeparatorChar + "ClientFileInfo.xml");  //创建xml文件
        }