
Subir archivo a SFTP
Publicado por Carlos (9 intervenciones) el 06/04/2016 16:35:47
Buen día,
Necesito subir un archivo .txt a un SFTP con una información que capto a través de un formulario.
Necesito subir un archivo .txt a un SFTP con una información que capto a través de un formulario.
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
Imports System.IO
Imports System.Text
Public Class Form1
Dim ruta = My.Computer.FileSystem.SpecialDirectories.Desktop & "\CLIENTE.txt"
Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub addbutton_Click(sender As Object, e As EventArgs) Handles addbutton.Click
' Declarar una variable StringBuilder con una longitud adecuada
Dim sb As New StringBuilder(String.Empty.PadLeft(416))
' Recuerda que los índices están en base cero, es decir
' la primera posición es el índice 0.
sb.Insert(0, novedad.Text)
sb.Insert(1, clientcode.Text)
sb.Insert(26, identificationtype.Text)
sb.Insert(28, identificationnumber.Text)
sb.Insert(48, clientname.Text)
sb.Insert(98, lastname.Text)
sb.Insert(148, realcename.Text)
sb.Insert(169, phone.Text)
sb.Insert(184, mail.Text)
sb.Insert(284, address.Text)
sb.Insert(384, danecode.Text)
sb.Insert(389, cardnumber.Text)
sb.Insert(405, expiration.Text)
sb.Insert(409, fromdate.Text)
sb.Insert(411, cardtype.Text)
Using sw As New StreamWriter(ruta, True)
sw.WriteLine(sb.ToString())
End Using
Dim Texto As Object
Texto = My.Computer.FileSystem.ReadAllText(String.Concat(ruta))
readbox.Text = Texto
MessageBox.Show("Registro Añadido")
End Sub
Private Sub clientname_TextChanged(sender As Object, e As EventArgs) Handles clientname.TextChanged
End Sub
Private Sub Label12_Click(sender As Object, e As EventArgs) Handles Label12.Click
End Sub
Private Sub mail_TextChanged(sender As Object, e As EventArgs) Handles mail.TextChanged
End Sub
Private Sub readbox_TextChanged(sender As Object, e As EventArgs) Handles readbox.TextChanged
End Sub
Private Sub clientload_btn_Click(sender As Object, e As EventArgs) Handles clientload_btn.Click
End Sub
End Class
Valora esta pregunta


0