Esempio n. 1
0
        void fileController_FileRequestReceived(string fileID, string senderID, string fileName, ulong fileLength, ResumedProjectItem resumedFileItem, string comment)
        {
            string directoryPath = Comment4NDisk.ParseDirectoryPath(comment);

            if (directoryPath == null)
            {
                return;
            }

            if (resumedFileItem != null)
            {
                this.fileController.BeginReceiveFile(fileID, resumedFileItem.LocalSavePath); //续传
                return;
            }

            string rootPath = this.networkDiskPathManager.GetNetworkDiskRootPath(senderID);

            this.fileController.BeginReceiveFile(fileID, rootPath + directoryPath);
        }
Esempio n. 2
0
        void fileOutter_FileRequestReceived(string projectID, string senderID, string fileName, ulong totalSize, ResumedProjectItem resumedFileItem, string comment)
        {
            string directoryPath = Comment4NDisk.ParseDirectoryPath(comment);

            if (directoryPath == null)
            {
                return;
            }

            //string savePath = resumedFileItem != null ? resumedFileItem.LocalSavePath : comment;
            //上述bug,2014.11.04修复
            string savePath = resumedFileItem != null ? resumedFileItem.LocalSavePath : directoryPath;
            string fullPath = this.ConstructFullPath(savePath);

            if (savePath != null && savePath.Length >= 2 && savePath[1] == ':') //表示为含驱动器的绝对路径。
            {
                fullPath = savePath;
            }
            this.fileOutter.BeginReceiveFile(projectID, fullPath);
        }