bien como dice el post es buscar la funcion mas rapida y valida de encontrar estos datos siendo como base de la funcion y que podria variar seria esta!
Function ListDir(ByVal StrPath as string)as string
podria ser cambiada por otros parametros o agregar parametros opcionales,,,,a medida que se postea los codes se iran probando yo probare en mi makina para que no varie en nada y se pondra la mejor y se podra hacer un post con esto. gracias y participen...esto agrande este subforo.
hay va una altenativa mas o menos distinta a la clasica noc fue al boleo. asi en 5 milisegundos. y unos 381 milisegundos cargando en combo o en debug
Function ListDir(ByVal StrPath As String) As ArrayList
Dim dir As DirectoryInfo = New DirectoryInfo(StrPath)
Dim ta As ArrayList = New ArrayList()
For Each subdir As DirectoryInfo In dir.GetDirectories
ta.Add(subdir.FullName)
Next
Return ta
End Function
nadie aporta.....solo piden ayuda..... :huh:
Ni idea si anda porq es la primera vez q hago un reto y no supe como probarlo sin perder tanto tiempo xD
Solo lo traduci a C# para no dejarte solo xD
List<string> ListDir(string StrPath)
{
DirectoryInfo dir = new DirectoryInfo(StrPath);
List<string> list = new List<string>();
foreach (DirectoryInfo subdir in dir.GetDirectories())
{
list.Add(subdir.FullName);
}
return list;
}
buenisimo man....:D....para probar haces esto.....
dim stopwatch as new stopwatch
stopwatch.start()
'aki pones la funcion...
stopwatch.stop()
debug.print(stopwatch.miliseconds())
Ja grcaias, aunque el debug.print no me aparece, me faltara agregar una referencia.. y no se cual es
Function ListDir(ByVal StrPath As String) As ArrayList
Dim dir As DirectoryInfo = New DirectoryInfo(StrPath)
Dim ta As ArrayList = New ArrayList()
For Each subdir As DirectoryInfo In dir.GetDirectories
ta.Add(subdir.FullName)
Next
For Each Filef As IO.FileInfo In dir.GetFiles
ta.Add(Filef.Name)
Next
Return ta
End Function
una mas