Bonjour,
je voudrais écrire dans un fichier texte:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
 
 
                Dim txt
                txt = IO.Path.GetFileNameWithoutExtension(TextBox1.Text)
                If IO.File.Exists(txt & ".txt") = False Then
                    IO.File.Create(txt & ".txt")
                End If
                ProgressBar1.Value = 50
                System.IO.File.WriteAllText(txt & ".txt", TextBox2.Text)
                System.IO.File.Copy(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) & "\piedrrum_prod\Multi-jeux\" & txt & ".txt", Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) & "\piedrrum_prod\Multi-jeux\txt-info\" & txt & ".txt")
                System.IO.File.Delete(txt & ".txt")
                ProgressBar1.Value = 75


mais j'obtiens une erreur comme "impossible d'accéder au fichier (chemindufichier) car celui-ci est en cours d'utilisation par un autre processus.

(au momment "System.IO.File.WriteAllText(txt & ".txt", TextBox2.Text")

je vous remercie,

Piedrrum