Bonjour à tous,
Je suis un peu embêtée. Je dois entrer un chemin d'accès d'un fichier texte(text1), lorsque je clic sur un bouton, le contenu de ce fichier doit s'afficher dans une zone texte (text3) et une autre zone de texte (text4), doit apparaitre le texte codé en +1 (a devient b,...).
Voilà ce que j'ai fais mais ça bug. Le contenu du fichier texte apparait dans la zone de text3 mais le débuggeur m'indique un problème dans : j(Crypt) = (Asc(j(Crypt))) + 1.
Pouvez-vous me dire où est le problème s'il vous plait, ça fait plus d'une semaine que je cherche et j'ai besoin de vos lumières.
Merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Private Sub Crypter_Click()
Crypte
End Sub
 
Private Sub Crypte()
Dim Chaine As String
Dim Source As Integer
Dim Ch As String
 
Source = FreeFile
Ch = Text1.Text
If Text1.Text = "" Then
End
End If
Open Ch For Input As #1
 
Text3.Text = ""
Do While Not EOF(1)
Line Input #1, Chaine
Text3.Text = Text3.Text & Chaine
Loop
Close #1
 
Dim Crypt As Integer
Dim Crypt2 As Integer
Dim j(5000)
 
For Crypt = 1 To 5000
 
j(Crypt) = Mid(Text3.Text, Crypt, 1)
j(Crypt) = (Asc(j(Crypt))) + 1
j(Crypt) = Chr(j(Crypt))
Next Crypt
 
For Crypt2 = 1 To Crypt
Text4.Text = Text3.Text & Crypt2
Next Crypt2
End Sub