Foros del Web » Programación para mayores de 30 ;) » .NET »

Ejecutar evento

Estas en el tema de Ejecutar evento en el foro de .NET en Foros del Web. Buenas noches Sres. del foro recurro a ustedes para que me ayuden con este codigo. que me facilitaron en la red pero no se como ...
  #1 (permalink)  
Antiguo 07/10/2013, 18:45
 
Fecha de Ingreso: julio-2012
Ubicación: panama
Mensajes: 19
Antigüedad: 11 años, 9 meses
Puntos: 0
Ejecutar evento

Buenas noches Sres. del foro recurro a ustedes para que me ayuden con este codigo.
que me facilitaron en la red pero no se como lanzarlo mediante un boton.

Private Sub moveOldfiles(sourceFolderPath As String,
destinationFolderPath As String,
thresholdCreationTime As Date,
Optional fileExtension As String = Nothing)
Dim sourceFolder As New DirectoryInfo("D:\NPRUEBA\bal")
Dim files = sourceFolder.GetFiles(If(String.IsNullOrEmpty(file Extension),
"*.exe",
"*.exe" & fileExtension))
For Each file In files
'Move the file if it was created before the threashold date/time.
If file.CreationTime < thresholdCreationTime Then
file.MoveTo(Path.Combine("D:\ENSAYO", file.Name))
End If
Next
End Sub

Espero me puedan ayudar

Saludos,
  #2 (permalink)  
Antiguo 08/10/2013, 09:37
 
Fecha de Ingreso: julio-2012
Ubicación: panama
Mensajes: 19
Antigüedad: 11 años, 9 meses
Puntos: 0
Respuesta: Ejecutar evento

eh probado con esto pero no ejecuta. no hace nada
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Call moveOldFiles()
End Sub

Sub moveOldFiles()
end sub
Private Sub moveOldfiles(sourceFolderPath As String,
destinationFolderPath As String,
thresholdCreationTime As Date,
Optional fileExtension As String = Nothing)
Dim sourceFolder As New DirectoryInfo("D:\NPRUEBA\bal")
Dim files = sourceFolder.GetFiles(If(String.IsNullOrEmpty(file Extension),
"*.exe",
"*.exe" & fileExtension))
For Each file In files
'Move the file if it was created before the threashold date/time.
If file.CreationTime < thresholdCreationTime Then
file.MoveTo(Path.Combine("D:\ENSAYO", file.Name))
End If
Next
End Sub

Etiquetas: evento
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:50.