martes, 27 de diciembre de 2016

Recorrer un datagridview


        For i As Integer = 0 To DataGridView1.Rows.Count - 1
            wr.WriteLine(DataGridView1(0, i).Value & "|" & DataGridView1(1, i).Value & "|" & DataGridView1(2, i).Value)
        Next


Agregar texto a botón en datagridview

-DataGridView Tasks -Edit Columns
-Seleccionar la columna Appearance:
-Text:
-UseColumnTextForButtonValue = True

jueves, 22 de diciembre de 2016

Botón para buscar archivo


        ' Dim openFileDialog1 As OpenFileDialog = New OpenFileDialog()
        Dim openFileDialog1 As New OpenFileDialog()
        openFileDialog1.Filter = "Acceso Directo (*.txt)|*.txt"
        If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
            tb_ruta_conex.Text = openFileDialog1.FileName
        Else
            Exit Sub
        End If


miércoles, 21 de diciembre de 2016

Extraer archivo de una ruta


Imports System.IO

'Obtener el nombre del archivo
Dim NombreDelArchivo As String = Path.GetFileName(ruta)

'Obtener el nombre del archivo sin extesión
Dim Archivo As String = Path.GetFileNameWithoutExtension(ruta)

miércoles, 14 de diciembre de 2016

Enviar archivos ftp bat

%windir%\system32\ftp.exe -s:%0
open 192.168.1.666 20
usuario
123
lcd C:\Users\archivos\Desktop\cc\x
binary
put Setup1.msi
quit
pause
fuente: http://www.ericphelps.com/batch/samples/ftp.script.txt

jueves, 1 de diciembre de 2016

Recorrer una lista y arreglo


Dim lista As List(Of String)
        For i As Integer = 0 To lista.Count - 1
            ' Código aquí...
        Next

Dim array() As String
        For j As Integer = 0 To array.Length - 1
            ' Código aquí...
        Next