Dim stringa As String = ""
For ct = 0 To RICEZIONE.Count - 1
stringa = stringa & RICEZIONE(ct)
Next
File.AppendAllText(MyPath & NomeFile, stringa)
Consiglio per dichiarazione variabile
Dim stringa As String = string.empty
oppure
Dim stringa As String = nothing
Poi, come viene popolato l'array? Non ha righe precise? Crealo in modo dinamico quando lo popoli, utilizza
dim aDati() as string
'popola array
for I =0 to XXX
Redim Preserve aDati(I)
aDati(I)="stringa" + I
next
Dim swTxt As StreamWriter
swTxt = File.CreateText(PathFile & "\" & NomeFileTxt)
'scrivi file
for I=0 to Ubound(aDati)
swTxt.Write(aDati(I))
End While
swTxt.Flush()
swTxt.Close()
Lanfra