📜  c# iformfile to string - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:20.810000             🧑  作者: Mango

代码示例1
public static List ReadAsList(this IFormFile file)
{
    var result = new StringBuilder();
    using (var reader = new StreamReader(file.OpenReadStream()))
    {
        while (reader.Peek() >= 0)
            result.AppendLine(reader.ReadLine()); 
    }
    return result;
}