文件查找代码?

慕田峪7331174
浏览 537回答 2
2回答

哆啦的时光机

'strDDir  要检索的目录,strSearchChr 要检索的文件名Private Function SetFileRB(ByVal strDDir As String, ByVal strSearchChr As String) As Integer        Dim dirInfo As New DirectoryInfo(strDDir)        Dim intCnt As Integer = 1        Dim intTemp As Integer = 0        If dirInfo.Exists Then            Dim files As FileInfo() = dirInfo.GetFiles(strSearchChr)            Dim i As Integer            For i = 0 To files.Length - 1        '自己的处理            Next        End If        Return intCnt    End Function

幕布斯7119047

String[] files = Directory.GetFiles("BasePath", "*autoCAD2005\acad.exe");//*匹配路径然后是对BasePath的递归查找,如果是你全匹配的返回路径。
打开App,查看更多内容
随时随地看视频慕课网APP