Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Decrypting A File
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01330998
Message ID:
01331100
Vues:
8
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform