(Suppose you mean how to copy the contents of a file into 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);
}
source
share