RY4*_*Y4N 20 c# asp.net wcf stream
我目前正在尝试从WCF下载音频轨道,我需要一些帮助将其写入硬盘,如何配置streamwriter或其他在webApp中执行此操作?
// Use Service to download stream (returns System.IO.Stream)
Stream stream = MyService.Download(("1231"));
// ReadStream
StreamReader reader = new StreamReader(stream);
reader.ReadToEnd();
// Write this stream to a file/Hard disk
???
Run Code Online (Sandbox Code Playgroud)
L.B*_*L.B 31
Stream stream = MyService.Download(("1231"));
using (Stream s = File.Create(path))
{
stream.CopyTo(s);
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
31219 次 |
最近记录: |