prog1001 |
177 !Ðß}¯>Ƚ)?½Ó·u?=uhb/_8½OèÆ(Þ8ãH)2+nÕpée áÌ"&²öé0_IèÒ½{Øã[û.¼YÐI.ÈSÏ·qÊV+2 ¢I¥3Ýo³öÏØF0¶/þÞ5y¨O¶Ê¦Ü
AÿIaz?SUÅcØ2^_á(ÊZZÓ>¢,eàeçH
voila, c'est la ou ça plante ! sinon voila la total du code des procedures de lecture et de sauvegarde (+ 2 ou trois autres trucs) de mon module.
y'a une parti de la lecture qui se fait en amont dans la form qui se lance en premier
En fait la sub LoadForm charge juste dans la RTB les infos de l'utilisateur sauf si criteria = faux.
L'erreur arrive la ou il y a les Debug.Print
bon j'espère que tu auras le courage de le lire.
si d'autres repèrent des anomalies, qu'ils n'hésite pas non plus de me prévenir.
Code :
- Public Const PassCrypt As String = "InfosPassProtect"
- Public Const PassTwo As String = "SC963."
- Public Type Record
- Name As String
- End Type
- Public a As Record
- Public OpenAccess As String
- Public NbLineFile As Long
- Public NumUsers As Long
- Public CPRESS As CPRESSDLL
- Public CRYPTE As CRYPTEURDLL
- Public Type USER
- NumCpte As Long
- PassWord As String
- NomCpte As String
- TypeCpte As Byte
- ' AcceCpte As Long
- Particularity As String
- End Type
- Public ADDUSER As USER
- Public Utilisateur() As USER
- Public USERCOUNT As Long
- Public USERACTIF As USER
-
- Public List1() As String
- Public List2() As String
- Public List3() As String
- Public IsCreate As Boolean
- Public USERCREATE As USER
- Public IsSuppr As Boolean
- Public USERSUPPR As USER
- Private MaxLenCarac As Integer
-
- Public Function AskPass(ByVal PassWord As String) As Boolean
- If PassWord = USERACTIF.PassWord Then AskPass = True
- End Function
- Public Function EtatCmdAction(ByVal Action As String) As String
- Select Case Action
- Case "Open"
- EtatCmdAction = "Ouvrir un compte"
- End Select
- End Function
- Public Sub LoadForm(ByVal Criteria As Boolean)
- ReDim List1(0)
- ReDim List2(0)
- ReDim List3(0)
- If Criteria = True Then
- A03Infos.Show
- End If
- Set CPRESS = New CPRESSDLL
- Set CRYPTE = New CRYPTEURDLL
- ReDim List1(0)
- A03Infos.Caption = "in - " & USERACTIF.NomCpte
- Open OpenAccess & "AlfaZZn.ced" For Random As #1
- Dim i1&
- '1111111111111111111111111111111111111111111111111111111111111111111111111
- Do While Not a.Name = "[User]"
- Get #1, , a.Name
- i1 = i1 + 1
- ReDim Preserve List1(i1)
- List1(i1) = a.Name
- Call Maximum(List1(i1))
- Call addPG
- a.Name = CRYPTE.RC4(a.Name, PassCrypt)
- Loop
- Do While Not a.Name = "[Fin]"
- Get #1, , a.Name
- i1 = i1 + 1
- ReDim Preserve List1(i1)
- List1(i1) = a.Name
- Call Maximum(List1(i1))
- Call addPG
- a.Name = CRYPTE.RC4(a.Name, PassCrypt)
- Loop
- '1111111111111111111111111111111111111111111111111111111111111111111111111
- '2222222222222222222222222222222222222222222222222222222222222222222222222
- 'Recherche du compte de l'utilisateur actif
- Do While Not ChargeList(Criteria, a.Name) = True
- Get #1, , a.Name
- i1 = i1 + 1
- ReDim Preserve List1(i1)
- List1(i1) = a.Name
- Call Maximum(List1(i1))
- Call addPG
- a.Name = CRYPTE.RC4(a.Name, PassCrypt)
- Loop
- If Criteria = True Then
- Else
- Close #1
- Exit Sub
- End If
- '2222222222222222222222222222222222222222222222222222222222222222222222222
- Dim i2&
- Open OpenAccess & "C###U#" & USERACTIF.NomCpte & USERACTIF.NumCpte & ".tmp" For Output As #2
- ReDim List2(0)
-
- Do While Not a1 = "[Fin]"
- Get #1, , a.Name
- a1 = CRYPTE.RC4(a.Name, PassCrypt)
-
- If a1 = "[Fin]" Then Exit Do
- i2 = i2 + 1
- ReDim Preserve List2(i2)
- List2(i2) = a.Name
- Call addPG
- a2 = CRYPTE.RC4(a.Name, USERACTIF.PassWord & PassTwo)
-
- DoEvents
- Print #2, a2
- Loop
- Len2 = i2
-
- Close #2
- A03Infos.RTBox1.LoadFile (OpenAccess & "C###U#" & USERACTIF.NomCpte & USERACTIF.NumCpte & ".tmp" )
- Kill OpenAccess & "C###U#" & USERACTIF.NomCpte & USERACTIF.NumCpte & ".tmp"
-
- Dim i3&
- i3 = 1
- ReDim List3(i3)
- List3(i3) = a.Name
- Call Maximum(List3(i3))
- Do While Not Loc(1) + 1 = Seek(1) 'A revoir
- Get #1, , a.Name
- i3 = i3 + 1
- ReDim Preserve List3(i3)
- List3(i3) = a.Name
- Call Maximum(List3(i3))
- Call addPG
- Loop
- Len3 = i3
- Close #1
- End Sub
- Private Function ChargeList(ByVal Criteria As Boolean, MyString As String) As Boolean
- If Criteria = True Then
- If MyString = "[" & USERACTIF.NumCpte & "]" Then ChargeList = True
- Else
- If EOF(1) = True Then ChargeList = True
- End If
- End Function
- Public Sub SavInFile()
- Set CPRESS = New CPRESSDLL
- Set CRYPTE = New CRYPTEURDLL
- A03Infos.RTBox1.SaveFile (OpenAccess & "C###U#" & USERACTIF.NomCpte & USERACTIF.NumCpte & ".tmp" )
- Dim i2&
- Open OpenAccess & "C###U#" & USERACTIF.NomCpte & USERACTIF.NumCpte & ".tmp" For Input As #2
- ReDim List2(0)
-
- Do While Not EOF(2)
- Line Input #2, a.Name
- i2 = i2 + 1
- ReDim Preserve List2(i2)
- List2(i2) = CRYPTE.RC4(a.Name, USERACTIF.PassWord & PassTwo)
- Call Maximum(List2(i2))
- Call addPG
- Loop
-
-
- Close #2
- Kill OpenAccess & "C###U#" & USERACTIF.NomCpte & USERACTIF.NumCpte & ".tmp"
- Open OpenAccess & "AlfaZZn.ced" For Output As #1
- 'Vide le fichier
- Close #1
- Dim MyChaine As String
- Open OpenAccess & "AlfaZZn.ced" For Random As #1 'Len = MaxLenCarac + 2
- Dim i1&
- Put #1, , CRYPTE.RC4("[NbLine]", PassCrypt)
- Put #1, , CRYPTE.RC4(UBound(List1, 1) + UBound(List2, 1) + UBound(List3, 1), PassCrypt)
- Put #1, , CRYPTE.RC4("[NumUsers]", PassCrypt)
- Put #1, , CRYPTE.RC4(NumUsers, PassCrypt)
- Dim UserFind As Boolean
- Dim UserFind2 As Boolean
- i1 = 5
- For i1 = 5 To UBound(List1, 1)
- If IsSuppr = True Then
- If List1(i1) = CRYPTE.RC4("[User]", PassCrypt) Then
- UserFind = True
- End If
-
- If List1(i1) = CRYPTE.RC4(USERSUPPR.NumCpte, PassCrypt) And UserFind = True Then
- If List1(i1 + 1) = CRYPTE.RC4(USERSUPPR.NomCpte, PassCrypt) Then
- If List1(i1 + 2) = CRYPTE.RC4(USERSUPPR.PassWord, PassTwo) Then 'a change en
- i1 = i1 + 5
- UserFind2 = True
- End If
- End If
- End If
-
- If List1(i1) = CRYPTE.RC4("[" & USERSUPPR.NumCpte & "]", PassCrypt) And UserFind2 = True Then
- Do While Not List1(i1) = CRYPTE.RC4("[Fin]", PassCrypt)
- i1 = i1 + 1
- Loop
- i1 = i1 + 1
- IsSuppr = False
- UserFind2 = False
- End If
- y = LOF(1)
- If i1 >= UBound(List1, 1) Then Exit For
- If List1(i1) = CRYPTE.RC4("[Fin]", PassCrypt) And UserFind = True Then
- UserFind = False
- End If
-
- End If
- If IsCreate = True Then
- If List1(i1) = CRYPTE.RC4("[User]", PassCrypt) Then
- UserFind = True
- End If
-
- If List1(i1) = CRYPTE.RC4("[Fin]", PassCrypt) And UserFind = True Then
- Put #1, , CRYPTE.RC4(USERCREATE.NumCpte, PassCrypt)
- Put #1, , CRYPTE.RC4(USERCREATE.NomCpte, PassCrypt)
- Put #1, , CRYPTE.RC4(USERCREATE.PassWord, PassTwo)
- Put #1, , CRYPTE.RC4(USERCREATE.TypeCpte, PassCrypt)
- ' Put #1, , CRYPTE.RC4(USERCREATE.AcceCpte, PassCrypt)
- Put #1, , CRYPTE.RC4(USERCREATE.Particularity, PassCrypt)
- UserFind = False
- End If
- End If
-
- Put #1, , List1(i1)
- ' p = Loc(1)
- Next
- i2 = 0
- For i2 = 1 To UBound(List2, 1)
- Debug.Print Len(List2(i2))
- Debug.Print List2(i2)
- Put #1, , List2(i2)
- ' p = Loc(1)
- Next
- Dim i3&
- i3 = 0
- For i3 = 1 To UBound(List3, 1)
- MyChaine = List3(i3)
- Put #1, , List3(i3)
- ' p = Loc(1)
- Next
- If IsCreate = True Then
- Put #1, , CRYPTE.RC4("[" & USERCREATE.NumCpte & "]", PassCrypt)
- Put #1, , CRYPTE.RC4("[Fin]", PassCrypt)
- IsCreate = False
- End If
- Close #1
- End Sub
- Public Sub KillCpte()
- IsSuppr = True
- End Sub
- Public Sub addPG()
- End Sub
- Public Sub Maximum(ByVal ListTruc As String)
- If Len(ListTruc) > MaxLenCarac Then MaxLenCarac = Len(ListTruc)
- End Sub
|
PS: La Sub Maximum ne sert plus. |