nnpc.net
当前位置:首页 >> VB如何查找E盘下所有文件名包含某字符的jpg文件 >>

VB如何查找E盘下所有文件名包含某字符的jpg文件

提供一个 VB 遍历指定文件夹下 文件的 代码 '查找第一个文件的API Public Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long '查找下一个文件

用Dir函数.用统配符去查,或者把.doc都查出来,循环里判断文件名的内容.再看看别人怎么说的.

算你找对人了~ 呵呵 vbs代码如下:(遍历e盘找到后以对话框的形式提示文件路径)Set Fsys=WScript.CreateObject("Scripting.FileSystemObject") dim s:Call Visit("e:") 'a b c d随自己改set file=fsys.createtextfile("list.txt") file.write s file.

这位在读硕士,如果你对楼上网友们的答复不够满意,请看看下面解答吧,慎重起见代码已通过实测,点击按钮实现你的要求:Private Sub Command1_Click() On Error GoTo err Dim file() As String, str As String, n As Long Dim dirxn As String,

不用vb,用dos命令就可以了c:\>dir e:\123\456\*.jpg /b > f:\789.txt就是把e盘123文件夹中的456文件夹里面的所有图片名称写到F盘789.txt文本文件里面.然后用记事本打开789.txt,用空字符替换掉所有的.jpg就是了.

Private PicName() As String '定义一个数组装入图片名称Sub GetPicName(ByVal sPath As String, ByVal Filter As String) '这是获取指定文件夹下指定后缀名的文件名称的过程,装入数组picname()中Dim sDir As StringDim sFilter() As

在程序文件夹下建立一个BAT文件命名为tree.bat,内容如下:tree e: /f >treeview.txt再加个按钮,click下添加如下代码:Shell App.Path & "\tree.bat"或者shell( "cmd /c tree e: /f >treeview.txt",1)

窗体上有一个LABEL 一个TEXT text的MultiLine 设为TRUE 一个COMMAND Public Sub SeachFile(ByVal strPath As String) On Error Resume Next Dim Fso As Object Dim Fol As Object Dim Fil As Object Dim MyName As String Set Fso =

控件:按钮一个 列表框一个 Function SearchFiles(Path As String, FileType As String)Dim Files() As String '文件路径Dim Folder() As String '文件夹路径Dim a, b, c As LongDim sPath As String sPath = Dir(Path & FileType) '查找第一个文件 Do While

private sub textbox1_textchanged(sender as object, e as eventargs) handles textbox1.textchanged abc(textbox1.text) end sub private function abc(byval s as string) as boolean if s.length = 0 or instr(s, " ") = 0 then abc = false : exit function dim r as

相关文档
网站首页 | 网站地图
All rights reserved Powered by www.nnpc.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com