[Visual Basic 2010] Problème
dampenfr31
Messages postés
281
Statut
Membre
-
meyileyfou Messages postés 9 Statut Membre -
meyileyfou Messages postés 9 Statut Membre -
Bonjour,
Je suis en ces moments en train de programmer un logiciel qui propose 2 langues (Anglais et Français) et pour sauvegarder la sélection de l'utilisateur, j'ai créer dans un dossier "Datas" un fichier DataLangage.dat dans lequel sera écrit 2 Lignes :
French=0
English=1
(ou inversement)
Voici mon code dans le load de la form 1 (pour lire le fichier si l'utilisateur a choisi anglais ou français) :
If Exists("Datas/DataLangage.dat") Then
Dim ioa As New IO.StreamReader("Datas/DataLangage.dat")
If ioa.ReadToEnd.Contains("French=1") Then
ioa.Close()
FormMenuFrancais.Show()
Me.Close()
ElseIf ioa.ReadToEnd.Contains("English=1") Then
ioa.Close()
FormMenuEnglish.Show()
Me.Close()
End If
Else
Create("Datas/DataLangage.dat")
End If
Mais quand je lance mon programme : Le processus ne peut pas accéder au fichier 'C:\User\*\*\Datas\DataLangage.dat', car il est en cours d'utilisation par un autre processus.
J'ai tout essayé mais rien n'y fait. Merci d'avance pour votre aide !
Je suis en ces moments en train de programmer un logiciel qui propose 2 langues (Anglais et Français) et pour sauvegarder la sélection de l'utilisateur, j'ai créer dans un dossier "Datas" un fichier DataLangage.dat dans lequel sera écrit 2 Lignes :
French=0
English=1
(ou inversement)
Voici mon code dans le load de la form 1 (pour lire le fichier si l'utilisateur a choisi anglais ou français) :
If Exists("Datas/DataLangage.dat") Then
Dim ioa As New IO.StreamReader("Datas/DataLangage.dat")
If ioa.ReadToEnd.Contains("French=1") Then
ioa.Close()
FormMenuFrancais.Show()
Me.Close()
ElseIf ioa.ReadToEnd.Contains("English=1") Then
ioa.Close()
FormMenuEnglish.Show()
Me.Close()
End If
Else
Create("Datas/DataLangage.dat")
End If
Mais quand je lance mon programme : Le processus ne peut pas accéder au fichier 'C:\User\*\*\Datas\DataLangage.dat', car il est en cours d'utilisation par un autre processus.
J'ai tout essayé mais rien n'y fait. Merci d'avance pour votre aide !
A voir également:
- [Visual Basic 2010] Problème
- Visual basic - Télécharger - Langages
- Visual basic editor - Télécharger - Langages
- Visual petanque - Télécharger - Sport
- Microsoft 365 basic - Accueil - Microsoft Office
- Visual c++ 2019 - Guide