Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem Decrypting A File
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01330998
Message ID:
01331100
Views:
7
Try putting a Thread.Sleep(10000) between the Encrypt and Decrypt method calls

>I am running the code found here: http://support.microsoft.com/kb/307010
>
>Here's how I calling the sample:
>
>
>class Program
>{
>    string sKey;
>
>    static void Main(string[] args)
>    {
>        Program oThis = new Program();
>        oThis.Encrypt();
>        oThis.Decrypt();
>    }
>
>    private void Encrypt()
>    {
>        string sFileName = "d:\\sql.txt";
>        string sOutputFile = "d:\\encrypted.txt";
>
>        FileCrypt.FileCrypt oFileCrypt = new FileCrypt.FileCrypt();
>
>        this.sKey = oFileCrypt.GenerateKey();
>        oFileCrypt.EncryptFile(sFileName, sOutputFile, sKey);
>    }
>
>    private void Decrypt()
>    {
>        string sFileName = "d:\\encrypted.txt";
>        string sOutputFile = "d:\\decrypted.txt";
>
>        FileCrypt.FileCrypt oFileCrypt = new FileCrypt.FileCrypt();
>        oFileCrypt.DecryptFile(sFileName, sOutputFile, this.sKey);
>    }
>}
>
>
>
>I get the error "The process cannot access the file 'd:\\encrypted.txt' because it is being used by another process."
>
>I have no idea what's holding this file after I encrypted it. How do I release the file?
>
>Thanks
Semper ubi sub ubi.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform