·  Start ·  Programme ·  Codes ·  Tipps ·  ActiveX ·  Tutorials · 



In diesem Beispiel wird lediglich eine einzige Datei gesucht (und evtl gefunden).

Private Declare Function SearchTreeForFile Lib "imagehlp" _
(ByVal RootPath As String, ByVal InputPathName As String, _
ByVal OutputPathBuffer As String) As Long
 
Private Const MAX_PATH = 255
 
Private Sub Command1_Click()
    ' Only one File will be searched !
    Dim SearchString As String, ReturnValue As Long
    SearchString = String(MAX_PATH, 0)
    ' "C:\" is the start
    ' "test.txt" is the file, you are searching for.
 
    ReturnValue = SearchTreeForFile("C:\", "test.txt", SearchString)
 
    ' Please wait while searching...
    If ReturnValue <> 0 Then
        Label1.Caption = "Searchresult: " & _
        Left(SearchString, InStr(1, SearchString, Chr$(0)) - 1)
    Else
        Label1.Caption = "File not found - try again"
    End If
 
End Sub
Aktualisiert: 12.02.2008, 14:10 Uhr Copyright © 2001 - 2010 by ST-software Navigation zurück  |  Navigation vorwärts  |  Zum Seitenanfang     
Ihre IP: 38.107.191.82 ·  Seite erstellt in: 0.430 Sekunden ·  Dateigröße:  2838 Bytes