Ars*_*yan 5 c# wcf wcf-streaming
我使用netTcpBinding和streaming将文件从一个服务器发送到另一个服务器,就像我在这个代码项目文章中所描述的那样,据我所知在wcf中我们想要发送流我们应该创建并将其作为消息契约返回,问题是如何获得完成文件发送?因为我想在文件发送保证完成时将文件从收件箱移动到发件箱
如果有人将来需要它,我在这个博客中找到了很好的解决方案
OperationContext clientContext = OperationContext.Current;
clientContext.OperationCompleted += new EventHandler(delegate(object sender, EventArgs args)
{
if (fileStream != null)
fileStream.Dispose();
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2117 次 |
| 最近记录: |