.Net VB6 en .Net Encore... SVP

cs_JeffC1977 Messages postés 928 Date d'inscription vendredi 10 novembre 2000 Statut Membre Dernière intervention 23 septembre 2023 - 15 août 2007 à 14:55
cs_JeffC1977 Messages postés 928 Date d'inscription vendredi 10 novembre 2000 Statut Membre Dernière intervention 23 septembre 2023 - 15 août 2007 à 15:16
C'est encore moi...
J'ai un Procédure qui mets un fichier texte (autre fonction) dans un tableau....
Serait-il possible de me convertir ce code en .NET SVP
Je crois que apres cette dernière demande de conversions, je devrais y arriver pour le reste.

Merci beaucoup d'avance...

Public Sub Parcourir_Fichier_text(aMesLignes)


    Dim i As Integer, j As Integer, LineCount As Integer
    Dim SplitLine() As String
    Dim intCompteur As Integer
    
   LineCount = 0
   For i = 0 To UBound(aMesLignes)
      If LineCount = 0 Then
            ReDim Tableau(4, LineCount)
        Else
            ReDim Preserve Tableau(4, LineCount)
        End If
   SplitLine = Split(aMesLignes(i), " ")
   For j = 0 To UBound(SplitLine)
            If Trim(SplitLine(j)) <> "" Then
                Tableau(j, LineCount) = Trim(SplitLine(j))
            End If
        Next
   LineCount = LineCount + 1
   Next i
End Sub

1 réponse

cs_JeffC1977 Messages postés 928 Date d'inscription vendredi 10 novembre 2000 Statut Membre Dernière intervention 23 septembre 2023 4
15 août 2007 à 15:16
Je vous montre là où il dit qu'il y a des erreurs....




Module




MDOLireFichier
   


Public
Tableau()

As



Object
<hr />
Public



Sub
Parcourir_Fichier_text(

ByVal
aMesLignes)


Dim
i

As



Integer
, j

As



Integer

Dim
LineCount

As



Integer

Dim
SplitLine()

As



String

Dim
intCompteur

As



Integer

LineCount = 0







For
i = 0

To
UBound(aMesLignes)
   

If
LineCount = 0

Then
      
ReDim


Tableau(4, LineCount)

   

Else
      
ReDim



Preserve


Tableau(4, LineCount)

   

End



If

SplitLine = Split( aMesLignes(i) ,




" "
)


For
j = 0

To
UBound(SplitLine)
   

If
Trim(SplitLine(j)) <>

""



Then
      
Tableau(j, LineCount) = Trim(SplitLine(j))
   

End



If

Next

LineCount = LineCount + 1


Next
i


End



Sub
0
Rejoignez-nous