3

I'm working on a project in VB.Net (2010) where I'm extracting files from an Document Management System.

The Files reside on the network, and information about the files are in a SQL 2005 Database and have been encrypted with the Encryption Stream (System.Security.Cryptography.RijndaelManaged)

I have retrieved the file, and decrypted them, but I'm trying to find out how to write the stream back to a file. I know the file type (which is stored in a SQL DB)

I can't find a solution in any of the VB files or the MS site.

Any help would be appreciated.

1
  • Do you know where on disk you want to save this file? If so, edit your question to include that information. Jul 6, 2011 at 15:00

2 Answers 2

4

To write a MemoryStream to a file just use the WriteTo method.

Using ms As MemoryStream = GetDecryptedMemoryStreamFromNetworkFile("network_file_path_goes here")
  Using fs As FileStream = File.OpenWrite("new_file_path_goes_here")
    ms.WriteTo(fs)
  End Using
End Using
0

Option 1 (obvious) is to create a temporary file on the disk.

Option 2 is to take something like our Callback File System product, which lets you do exactly what you need and many of our customers use it for scenarios like yours, i.e. represent data taken from document management systems and similar storages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.