
Ayuda no me guarda bien el bucle de mi array
Publicado por Mark (5 intervenciones) el 19/05/2023 18:29:44
Tengo problemas con mi archivo porque es en una sola linea con 6 campos que voy a ocupar con al conexión
pero me sale un lineaLinea cannot be parsed using the current Delimiters. is not valid and will be skipped.
pero me sale un lineaLinea cannot be parsed using the current Delimiters. is not valid and will be skipped.
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
Public Sub Conexion(ByVal CarpetaOrigen As String, ByVal Unidad As Char, ByVal Nombredeusuario As String, ByVal Contraseña As String, ByVal Origen As String, ByVal Destino As String)
Try
'Inventarios Documentales - DAFMap(CarpetaOrigen, Unidad, True, Nombredeusuario, Contraseña)
lbl1.Text = "Se conectó"
Dim files As List(Of IO.FileInfo) = GetFiles(Origen, "*.xlsx")
Dim fileNames As List(Of String) =
(From file As IO.FileInfo In files
Order By file.LastWriteTimeSelect file.FullName).ToList()
Dim n As Integer = CopyFiles(Destino, fileNames)
lbl2.Text = String.Format("Se realizó la copia", n)
Unmap("B,A")
lbl3.Text = "Se desconectó"
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
Private Sub Guardar_Click(sender As Object, e As EventArgs) Handles Guardar.Click
Using Variables As New Microsoft.VisualBasic.FileIO.TextFieldParser("C:\Users\Fabian Gallegos\Desktop\VariblesN.txt")
Variables.TextFieldType = FileIO.FieldType.Delimited
Variables.SetDelimiters(",")
Dim Val As String()
ReDim Preserve Val(250)
'Dim ValMap As String Dim J = 0 Dim i As Long = 0 While Not Variables.EndOfDataTry
Val = Variables.ReadFields()
For i = 0 To 100 Step 6CarpetaOrigen = Val(i + 0)
Unidad = Val(i + 1)
Nombredeusuario = Val(i + 2)
Contraseña = Val(i + 3)
Origen = Val(i + 4)
Destino = Val(i + 5)
Call Conexion(CarpetaOrigen, Unidad, Nombredeusuario, Contraseña, Origen, Destino)
Next i
Catch ex As Microsoft.VisualBasic.FileIO.MalformedLineException
MsgBox("line" & ex.Message & "is not valid and will be skipped.")
End Try
End While
End Using
End Sub
Valora esta pregunta


0