This site uses cookies own and third. If you continue to browse consider to accept the use of cookies. OK More Info.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - _katze_

Pages: [1]
1
C# - VB.NET / Minireto listar directorios & archivos
« on: February 25, 2011, 09:05:20 pm »
esta es una forma de obtener los archivos y directorios que le pasamos como parametro aver quien me propone una mejor y mas rapida.
en un listbox y pasando como parametro "C:\windows\system32" me carga en 99 milisegundos je
Code: (csharp) You are not allowed to view links. Register or Login
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

2
C# - VB.NET / [RETO] IsFibonacciNumber(N as long) as Boolean
« on: February 16, 2011, 08:51:59 pm »
este es un reto q esta en otro foro y la verdad para empesar a hacer algo lo vamos a hacer pero en .net

Para informacion acerca de la Secuencia de Fibonacci:
You are not allowed to view links. Register or Login
codigo de ejemplo para sugerir ideas pero esta en vb6 no hacer de esta manera
Code: You are not allowed to view links. Register or Login
Public Static Function IsFibonacci(ByVal lngNumber As Long) As Boolean
Dim dblRaised                                       As Double
Dim dblSum                                          As Double
Dim dblSqr                                          As Double
 
    dblRaised = lngNumber * lngNumber
    dblSum = dblRaised + dblRaised + dblRaised + dblRaised + dblRaised + &H4
    dblSqr = Sqr(dblSum)
    IsFibonacciMrFrog = (dblSqr - CLong(dblSqr) = &H0)
    If IsFibonacciMrFrog Then Exit Function
    dblSum = dblSum - &H8
    dblSqr = Sqr(dblSum)
    IsFibonacciMrFrog = (dblSqr - CLong(dblSqr) = &H0)
End Function

Pages: [1]