Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C# WinForm
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 11:44am
Sergey Alexandrovich Kryukov at 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 at 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
0 OriginalGriff 723
1 George Jonsson 370
2 BillWoodruff 277
3 Garth J Lancaster 250
4 Sergey Alexandrovich Kryukov 249
0 Sergey Alexandrovich Kryukov 10,764
1 Maciej Los 5,474
2 OriginalGriff 5,472
3 CPallini 3,819
4 BillWoodruff 3,594

Advertise | Privacy | Mobile
Web03 | 2.8.141030.1 | Last Updated 23 Jun 2012
Copyright © CodeProject, 1999-2014
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