コード例 #1
0
ファイル: Service.svc.cs プロジェクト: afrog33k/eAd
        public FileDownloadReturnMessage DownloadFile(FileDownloadMessage request)
        {
            FileDownloadReturnMessage message;

            string localFileName = request.MetaData.LocalFileName;

            try
            {
                string str2 = ConfigurationManager.AppSettings["FileTransferPath"];

                string path = Path.Combine(str2, request.MetaData.RemoteFileName);

                Stream stream = new FileStream(path, FileMode.Open);

                message = new FileDownloadReturnMessage(new FileMetaData(localFileName, path, "1"), stream);
            }

            catch (IOException exception)
            {
                throw new FaultException <IOException>(exception);
            }

            return(message);
        }
コード例 #2
0
ファイル: Service.svc.cs プロジェクト: afrog33k/eAd
    public FileDownloadReturnMessage DownloadFile(FileDownloadMessage request)
    {
        FileDownloadReturnMessage message;

        string localFileName = request.MetaData.LocalFileName;

        try
        {
            string str2 = ConfigurationManager.AppSettings["FileTransferPath"];

            string path = Path.Combine(str2, request.MetaData.RemoteFileName);

            Stream stream = new FileStream(path, FileMode.Open);

            message = new FileDownloadReturnMessage(new FileMetaData(localFileName, path, "1"), stream);
        }

        catch (IOException exception)
        {
            throw new FaultException<IOException>(exception);
        }

        return message;
    }