Answers for "c# stream to text file"

3

C# save pdf stream to file

using (var fileStream = File.Create("C:\Path\To\File"))
{
    myStream.Seek(0, SeekOrigin.Begin);
    myStream.CopyTo(fileStream);
}
Posted by: Guest on April-29-2020
2

c# read file stream

//this will get a string with all the text from the file
var fileText = File.ReadAllText(@"pathtomyfile.txt");

//this will get all of the lines of the file as an string[]
var fileLines = File.ReadAllLines(@"pathtomyfile.txt");
Posted by: Guest on February-17-2020

Browse Popular Code Answers by Language