zoukankan      html  css  js  c++  java
  • 全硬盘高速查找指定文件

    Private Declare Function SearchTreeForFile Lib "ImageHlp.dll" (ByVal lpRoot As String, ByVal lpInPath As String, ByVal lpOutPath As String) As Long
    Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
    Function SearchFile(ByVal Filename As String) As String
        Dim R As Long, i As Long, SearchPath As String
        For i = 0 To 25
        SearchPath = Chr$(i + 65) & ":/"
        If GetDriveType(SearchPath) = 3 Then
            SearchFile = String$(1024, 0)
            R = SearchTreeForFile(SearchPath, Filename, SearchFile)
            If R <> 0 Then SearchFile = Split(SearchFile, Chr(0))(0): Exit Function
            End If
        Next
        SearchFile = "Can't find it is this system"
    End Function

    Sub macro1()
        Dim F As String
        F = InputBox("Please input a filename to search", "Infomation", "excel.exe")
        MsgBox SearchFile(F)
    End Sub 
  • 相关阅读:
    Linux文件及目录查找
    英语单词independent
    英语单词omitting
    英语单词deploy
    英语单词debug
    线程
    进程
    操作系统历史
    分布式爬虫
    爬虫基础
  • 原文地址:https://www.cnblogs.com/fengju/p/6336306.html
Copyright © 2011-2022 走看看