📄 8590.html
字号:
<html>
<head>
<title>还是有问题.</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>还是有问题.</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:winntuser@hotmail.com">Windows NT user</a> on December 24, 1998 at 15:43:21:<p>
In Reply to: <a href="8573.html">Re: 还有问题.</a> posted by 晓芳 on December 24, 1998 at 09:17:34:<p>
: : : : 如何寻找在c:\里*.exe档,并把结果存入一个字串阵列呢?<br>: : : 执行DIR("C:\*.EXE")会传回目录中第一个.EXE的档案,<br>: : : 如果接着再执行DIR()不加参数,则传回第二固.EXE档,<br>: : : 直到传回空字串就表示没有.EXE档了!<br>: : : 这样应该就知道怎么做了吧!<p>: : 这个我知道,但怎样连子目录里的档案也找出来?<br>: 下面这段程式可以将C:\的所有子目录全找出来,再配合<br>: 上面的DIR()就可以达到你的要求了!<br>: Private Sub Command1_Click()<br>: Dim MYPATH As String, MYNAME As String<br>: MYPATH = "c:\" ' Set the path.<br>: MYNAME = Dir(MYPATH, vbDirectory) ' Retrieve the first entry.<br>: Do While MYNAME <> "" ' Start the loop.<br>: ' Ignore the current directory and the encompassing directory.<br>: If MYNAME <> "." And MYNAME <> ".." Then<br>: ' Use bitwise comparison to make sure MyName is a directory.<br>: If (GetAttr(MYPATH & MYNAME) And vbDirectory) = vbDirectory Then<br>: Debug.Print MYNAME ' Display entry only if it<br>: End If ' it represents a directory.<br>: End If<br>: MYNAME = Dir ' Get next entry.<br>: Loop<br>: End Sub<p>但是这段程式码只能找出在根目录下一层的目录,再下一层的目录又怎样找出来呢?<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 8590-->
<!--top: 8598--><li><a href="8598.html">Re: 还是有问题.</a> <b>晓芳</b> <i>21:00:44 12/24/98</i>
(<!--responses: 8598-->1)
<ul><!--insert: 8598-->
<!--top: 8603--><li><a href="8603.html">Re: 还是有问题.</a> <b>晓芳</b> <i>21:36:46 12/24/98</i>
(<!--responses: 8603-->0)
<ul><!--insert: 8603-->
</ul><!--end: 8603-->
</ul><!--end: 8598-->
</ul><!--end: 8590-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -