【发布时间】:2009-10-06 02:16:00
【问题描述】:
我有以下代码将(文件)流发送到 wcf 客户端:
public Stream Download( string path )
{
try
{
FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read);
return stream;
}
catch (Exception ex)
{
string error = ex.Message;
return null;
}
}
我希望能够在客户端获取发送流的长度,但是 Stream 类不支持这个。
最好的方法是什么?
谢谢, 托尼
【问题讨论】: