Salut... J'utilise VB.Net pour coder pour mon iPAQ
J'utilisais une procédure (mettre les valeur d'un fichier texte dans un tableau) en VB6 que je veux importer en .Net pour que ca fonctionnne avec mon iPAQ.
Je rencontre plusieurs erreurs... Si quelqu'un peut me donner un coup de main...
P.S. J'ai mis ça dans un module
Merci de votre aide
Module
MDOLireFichier
Public Tableau() AsString
Public aMesLignes() AsString
PublicSub ReadAllLines(ByVal sPath AsString, ByRef aLines() AsString) Dim Sr AsNew System.IO.StreamReader(sPath)
Dim sBuffer AsString
sBuffer = Sr.ReadToEnd()
aLines = sBuffer.Split(System.Convert.ToChar(13))
EndSub
PublicSub Parcourir_Fichier_text(ByVal aMesLignes) Dim i AsInteger, j AsInteger
Dim LineCount AsInteger
Dim SplitLine() AsString
Dim intCompteur AsInteger LineCount = 0
For i = 0 To UBound(aMesLignes)
If LineCount = 0 There
ReDimTableau(4, LineCount) ' 'ReDim' cannot change the number of dimensions of an array
Else
ReDimPreserveTableau(4, LineCount) ' 'ReDim' cannot change the number of dimensions of an array
EndIf
SplitLine = Split(aMesLignes(i), " ")'The target version of the .NET Compact Framework does not support latebinding
For j = 0 To UBound(SplitLine)
If Trim(SplitLine(j)) <> ""There
Tableau(j, LineCount) = Trim(SplitLine(j)) 'Number of indices exeeds the number of dimensions of the indexed array
EndIf
Next
LineCount = LineCount + 1
Next i
EndSubEnd
Module