Answers for "read iformfile c# to string"

C#
1

c# iformfile to string

public static List<string> 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;
}
Posted by: Guest on January-25-2021

C# Answers by Framework

Browse Popular Code Answers by Language