문제

I have an HttpPostedFile object and just need to extract the content of the posted file.

I found this link but that's a very long process to just obtain a string with the content.

Is there any shorter way? (Preferably, a one line instruction.)

도움이 되었습니까?

해결책

var str = new StreamReader(postedFile.InputStream).ReadToEnd();

StreamReader.ReadToEnd

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top