Bonjour je voudrais faire une application qui demande d entré un login et mot de passe qui sont dans un fichier texte le probleme c est que je n arrive pas a mettre le mot de passe et login dans 2 variables car pourle moment le mot de passe et login sont dans une seul variable donc je voudrais bien decomposé cette variable voici mon code:
sur ma form se trouve 2 label 2 textbox et 2 bouton : ok et annulé
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112 Dim str_fichier_utilisateurs As String Dim str_ligne As String Dim int_nbr_mot As Integer Dim tab_chaine_du_fichier() As String Public Function FONCTION_CHEMIN_COURANT(str_fichier_utilisateurs As String) As String Dim str_chemin As String str_chemin = App.Path If Right(str_chemin, 1) <> "\" Then str_chemin = str_chemin + "\" FONCTION_CHEMIN_COURANT = str_chemin + str_fichier_utilisateurs End Function Private Sub bouConnect_Click() Call PROCEDURE_DECOMPOSITION_LIGNE_EN_MOT For i = 1 To int_nbr_mot List1.AddItem (tab_chaine_du_fichier(i)) Next i End Sub Private Sub Form_Load() Form1.Show str_fichier_utilisateurs = "utilisateurs.seq" Open FONCTION_CHEMIN_COURANT(str_fichier_utilisateurs) For Input As #1 Close #1 Call PROCEDURE_LIRE_FICHIER Label1.Caption = str_ligne End Sub Public Function FONCTION_NOMBRE_RECORDS() As Integer Dim Int_compteur As Integer Dim int_i As Integer Open FONCTION_CHEMIN_COURANT(str_fichier_utilisateurs) For Input As #1 Do Until EOF(1) Input #1, str_ligne Int_compteur = Int_compteur + 1 Loop Close #1 FONCTION_NOMBRE_RECORDS = Int_compteur End Function Public Sub PROCEDURE_LIRE_FICHIER() Dim int_i As Integer Open FONCTION_CHEMIN_COURANT(str_fichier_utilisateurs) For Input As #1 Do Until EOF(1) Line Input #1, str_ligne Loop Close #1 End Sub Public Sub PROCEDURE_DECOMPOSITION_LIGNE_EN_MOT() Dim int_long As Integer Dim int_i As Integer Dim int_j As Integer Dim str_mot As String int_long = Len(str_ligne) For i = 1 To int_long str_mot = str_mot + Mid(str_ligne, 1, i) If Mid(str_ligne, 1, i) = " " Then int_j = int_j + 1 ReDim Preserve tab_chaine_du_fichier(1 To int_j) tab_chaine_du_fichier = RTrim(mot) str_mot = "" End If Next i int_j = int_nbr_mot End Sub
merci d avance pour votre aide
Donc je voudrais juste de l aide sur la decomposition de la variable str_ligne en deux variables.
Partager