【发布时间】:2023-03-17 01:09:01
【问题描述】:
我想将上传文件的数据复制到 IList 对象。上传的文件是 .csv-data。
我的代码如下所示:
public void FileToIList(IFormFile importFile)
{
if (importFile != null)
{
//var path = Path.Combine(wwwrootDiectory, DateTime.Now.Ticks.ToString() + Path.GetExtension(importFile.FileName));
//IList<string> = importFile.OpenReadStream().Read() <= does not work
}
但我不想将 importFile 的内容保存在临时数据中。我想直接将内容写入 IList 对象。有可能吗?
在这行之后,我不知道更多。 您有解决方案或想法吗?
【问题讨论】:
标签: c# .net .net-core filestream