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 
  • 相关阅读:
    1 3
    linux常用命令
    linux的目录结构
    linux的shell编程
    linux的IP配置
    linux安装
    linux简介
    ubuntu16.04上系统管理服务和配置
    PXE
    RPC框架原理
  • 原文地址:https://www.cnblogs.com/fengju/p/6336306.html
Copyright © 2011-2022 走看看