Пример #1
0
 private async Task CopyFileAsync(string path, HttpListenerContext context, CancellationToken ct)
 {
     using (DataTransferSession dts = new DataTransferSession(_session, FileSystem)) {
         await dts.CopyToFileStreamAsync(path, context.Response.OutputStream, true, null, ct);
     }
     context.Response.OutputStream.Close();
 }