コード例 #1
0
ファイル: Program.cs プロジェクト: zz119/FastDFS.Net
        void DoDownload(StorageNode node, string fileId, string destFileName)
        {
            //get metadata
            IDictionary <string, string> metaData = FastDFSClient.GetMetaData(node, fileId);

            //download file
            string destDir  = Environment.CurrentDirectory;
            string destName = metaData["filename"] + Path.GetExtension(fileId);

            if (!string.IsNullOrEmpty(destFileName))
            {
                string dir = Path.GetDirectoryName(destFileName);
                if (!string.IsNullOrEmpty(dir))
                {
                    destDir = dir;
                }

                destName = Path.GetFileName(destFileName);
            }

            string fullName = FastDFSClient.DownloadFileEx(node, fileId, destDir, destName);

            Console.WriteLine("{0}", fullName);
        }