예제 #1
0
 public NamedStream[] ReadSave(string directory)
 {
     string[]      files = Directory.GetFiles(directory);
     NamedStream[] ret   = new NamedStream[files.Length];
     for (int x = 0; x != files.Length; x++)
     {
         string filename = files[x];
         for (int fnw = filename.Length - 1; fnw > 0; fnw--)
         {
             if (filename[fnw] == '/' || filename[fnw] == '\\')
             {
                 filename = filename.Substring(fnw);
                 break;
             }
         }
         ret[x] = new NamedStream(File.Open(files[x], FileMode.Open, FileAccess.Read, FileShare.Read), filename);
     }
     return(ret);
 }
예제 #2
0
 public NamedStream[] ReadSave(string directory)
 {
     string[]      files = parent.device.GetFiles(directory);
     NamedStream[] ret   = new NamedStream[files.Length];
     for (int x = 0; x != files.Length; x++)
     {
         string filename = files[x];
         for (int fnw = filename.Length - 1; fnw > 0; fnw--)
         {
             if (filename[fnw] == '/' || filename[fnw] == '\\')
             {
                 filename = filename.Substring(fnw);
                 break;
             }
         }
         MemoryStream file = new MemoryStream();
         parent.device.DownloadFile(files[x], file);
         file.Position = 0;
         ret[x]        = new NamedStream(file, filename);
     }
     return(ret);
 }
예제 #3
0
 public NamedStream[] ReadSave(string directory)
 {
     string[]      files = client.DirectoryListSimple(directory);
     NamedStream[] ret   = new NamedStream[files.Length - 1];
     for (int x = 0; x != files.Length - 1; x++)
     {
         string filename = mainDir + "/" + files[x];
         for (int fnw = filename.Length - 1; fnw > 0; fnw--)
         {
             if (filename[fnw] == '/' || filename[fnw] == '\\')
             {
                 filename = filename.Substring(fnw);
                 break;
             }
         }
         MemoryStream file = client.Download(directory + "/" + files[x]);
         //Console.WriteLine(directory + "/" + files[x]);
         file.Position = 0;
         ret[x]        = new NamedStream(file, filename);
     }
     return(ret);
 }