c# - create file and save to it using memorystream -


how can create file , write using memory stream? need use memorystream prevent other threads trying access file.

the data i'm trying save file html.

how can done?

(presuming mean how copy file's content memory stream)

if using framework 4:

     memorystream memorystream = new memorystream();      using (filestream filestream = new filestream(filepath, filemode.open, fileaccess.read))      {        filestream.copyto(memorystream);      } 

Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

jtree - comparing two TreeNode (or DefaultMutableTreeNode) objects in Java Comparator -