Private Sub Form_Load()
Dim sPath As String, sName As String
sPath = "C:\"
sName = Dir$(sPath, vbDirectory)
Do While sName <> ""
If sName <> "." And sName <> ".." Then
If GetAttr(sPath & sName) And Not vbArchive Then
List1.AddItem sName
End If
End If
sName = Dir$()
Loop
to: wstar(星) ( )
vb中的integer是有符号数,超过了32768就要溢出啦,你用一个long 来存储就可以了。
vb连无符号数都不提供,挺烦的
是dirlistbox的问题,你可以试一试,一个目录(C:\test)下有40000个目录,然后
dim i,k as long
dim j as string
dir1.path="c:\test"
k=dir1.listcount
for i=0 to 40000
j=dir1.list(i)
next i
超过32767就溢出了,呵呵,而且dir1.listcount是负数...