Click here to Skip to main content
13,357,380 members (71,751 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi friends,

I have a winform that encrypt and decrypt a file... it's OK,

BUT the problem is it saves the decrypted file to the hard disk, and then i could use it !
Is there any way to reuse the decrypted file without saving it in hard disk ( that the user can see the decrypted file is the problem ! )
for example can i save the file to memory (RAM) and use it as an stream !?
i have searched alot, and i found just memorystream(..).if it's the answer then how should i use it !!?
i'll appreciate any help,
and sorry for my bad english.
Posted 23-Jun-12 12:44pm
Sergey Alexandrovich Kryukov 23-Jun-12 19:16pm
Not clear what's the problem. The memory stream is not worse than any other stream, why not using it? What's the difference from you?
Mohamad77 24-Jun-12 4:20am
my code use these lines to save decrypted file to hard disk, then i should use the file, BUT in this way the user can see and access the decrypted file and copy it !
my question is that i want to use the decrypted file without saving it to hard disk !
if Memorystream is the answer, then how should i use it !?

FileStream fsOut = new FileStream("output decrypted file address here", FileMode.Create);

int data;
while ((data = cs.ReadByte()) != -1)

thanks alot.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 23 Jun 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100