Hi,
How can i create a file and write to it using the memory stream? I need to use the memorystream to prevent other threads from trying to access the file.
The data i'm trying to save to a file is html.
How can this be done?
Hi,
How can i create a file and write to it using the memory stream? I need to use the memorystream to prevent other threads from trying to access the file.
The data i'm trying to save to a file is html.
How can this be done?
(Presuming you mean how to copy a file's content to a memory stream)
If you are using framework 4:
MemoryStream memoryStream = new MemoryStream();
using (FileStream fileStream = new FileStream(FilePath, FileMode.Open, FileAccess.Read))
{
fileStream.CopyTo(memoryStream);
}