none
FileStream写文件内存持续上涨

    问题

  •  foreach (var item in scores)
                {
                    var download = _downloadService.GetDownloadById(t.FileId);
                    try
                    {
                        byte[] bytes = download.DownloadBinary;
                        using (FileStream fs = new FileStream(@"d:\Words\" + examinationCardNo  + download.Extension, FileMode.Create, FileAccess.Write))
                        {
                            fs.Write(bytes, 0, bytes.Length);
                            fs.Flush(true);
                            fs.Close();
                            fs.Dispose();
                        }
                    }
                    catch (Exception ex)
                    {
                    }
                    GC.Collect();
                }

    byydtk

    2015年12月24日 14:25

答案