Exemple #1
0
 private void ReadFile(FilePathInfo pathInfo)
 {
     FileStream fs = new FileStream(pathInfo.Path, FileMode.Open);
     var img = new byte[fs.Length];
     fs.Read(img, 0, img.Length);
     fs.Close();
     fs.Dispose();
     dataDict[pathInfo.VfsPath] = img;
 }
        private void ReadFile(FilePathInfo pathInfo)
        {
            FileStream fs  = new FileStream(pathInfo.Path, FileMode.Open);
            var        img = new byte[fs.Length];

            fs.Read(img, 0, img.Length);
            fs.Close();
            fs.Dispose();
            dataDict[pathInfo.VfsPath] = img;
        }
Exemple #3
0
 private static void CheckDirectory(string path, string nowDir)
 {
     foreach (var file in Directory.GetFiles(path))
     {
         FilePathInfo info = new FilePathInfo();
         info.Path = file;
         var lastPath = file.LastIndexOf('\\');
         var fileName = file.Substring(lastPath + 1);
         info.VfsPath = nowDir == "" ? fileName : nowDir + "." + fileName;
         pathList.Add(info);
     }
     foreach (var directory in Directory.GetDirectories(path))
     {
         DirectoryInfo directoryInfo = new DirectoryInfo(directory);
         CheckDirectory(directory, nowDir == "" ? directoryInfo.Name : nowDir + "." + directoryInfo.Name);
     }
 }
Exemple #4
0
        private static void CheckDirectory(string path, string nowDir)
        {
            foreach (var file in Directory.GetFiles(path))
            {
                FilePathInfo info= new FilePathInfo();
                info.Path = file;
                var lastPath = file.LastIndexOf('\\');
                var fileName = file.Substring(lastPath+1);
                info.VfsPath = nowDir == "" ? fileName : nowDir + "." + fileName;
                pathList.Add(info);

            }
            foreach (var directory in Directory.GetDirectories(path))
            {
                DirectoryInfo directoryInfo = new DirectoryInfo(directory);
                CheckDirectory(directory, nowDir == "" ? directoryInfo.Name : nowDir + "." + directoryInfo.Name);
            }
        }