*
peter@mclinn.com (Peter) scripsit:[color=blue]
> I have a component that encrypts/decrypts files using Rijndael
> encryption. The component works flawlessly but I want to try to
> extend its capablities and this is my general question:
>
> I have an "in" and a "out" function.
>
> The in function supplys the name of the location of where the file to
> be encrypted resides and the "out" function specifies the location of
> where to write the outputed encrypted file. Both function require a
> string.
>
> Instead of writing this encrypted file back to the drive I would like
> to store it in a variable, read information from this file, and then
> dump the variable.[/color]
Take a look at the 'System.IO.BinaryReader'. You can use this class to
read the contents of a file into a byte array. Depending on how your
encryption algorithms work, you may want to specify a 'MemoryStream' as
output stream, and later use a 'BinaryReader' + 'BinaryWriter' to read
data fro0m the memory stream and write it to the output file.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>