Esempio n. 1
0
        public string GetPath(JianLi3Data.File f)
        {
            string filepath = "";

            if (!FileCache.Default.TryGetFile(f.FileID, out filepath))
            {
                filepath = DownloadFile(f.FilePath);
                FileCache.Default.AddFile(f.FileID, filepath);
            }
            return(filepath);
        }
Esempio n. 2
0
        public string MoveToLib(string filepath, JianLi3Data.File f)
        {
            string destpath = Path.Combine(BookLibFolder, f.FilePath);

            if (System.IO.File.Exists(destpath))
            {
                destpath = JianLiIO.FindNewFileName(destpath);
            }

            System.IO.File.Move(filepath, destpath);

            return(destpath.Substring(BookLibFolder.Length + 1, destpath.Length - BookLibFolder.Length - 1));
        }
Esempio n. 3
0
        public string MoveToLib(string filepath, JianLi3Data.File f)
        {
            string serversubpath;

            FileStream stream = new FileStream(filepath, FileMode.Open);

            client.UploadFile(Path.GetFileName(filepath), stream);
            stream.Close();

            string[] segs = f.FilePath.Split(new char[] { '\\' });

            if (segs.Length == 2)
            {
                serversubpath = client.MoveIncontrolFolder(segs[1], segs[0]);
            }
            else
            {
                serversubpath = client.MoveIncontrolFolder(segs[0], "");
            }

            FileCache.Default.AddFile(f.FileID, filepath);

            return(serversubpath);
        }
Esempio n. 4
0
 public string GetPath(JianLi3Data.File f)
 {
     return(Path.Combine(BookLibFolder, f.FilePath));
 }