使用C#WebAPI更新IFORMFILE

时间:2019-04-18 09:50:04

标签: c# asp.net .net asp.net-mvc asp.net-web-api

    I have an excel/csv file w with one column ID. Here i want to remove the duplicate ID elements from the file and update the same file by removing the duplicated record.

也想用删除/复制的数据创建一个新文件,只是为了证明这些数据已被消除。如何使用C#webapi实现它。

I am using IFormFile.
    var result = new StringBuilder();
    using (var reader = new StreamReader(iFormFile.OpenReadStream()))
    {
      while (reader.Peek() >= 0) //read till eof
       result.AppendLine(await reader.ReadLineAsync());
   }



 I have written code to read the file as mentioned below. Can anyone help me with removing the duplicated record and creating a new file.

    Here is the code i have written so far to read from file

0 个答案:

没有答案