如何得到文件(例:"C:\aa.txt")的若干信息:1.名称2.所在文件夹3.大小4.类型5.修改时间???

sunfei4000 2003-12-08 03:30:57
如何得到文件(例:"C:\aa.txt")的若干信息:
1.名称2.所在文件夹3.大小4.类型5.修改时间???
...全文
12 点赞 收藏 10
写回复
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
guohong1219 2003-12-09
给我你的邮箱我刚刚做了一个
回复
boydgmx 2003-12-08
FileSystemObject
回复
SoHo_Andy 2003-12-08
已经发送
回复
sunfei4000 2003-12-08
谢过lxcc(虫子)~~!@~@
回复
flc 2003-12-08
关注
学习
帮你UP
回复
sunfei4000 2003-12-08
delppiyelo@sina.com
回复
lxcc 2003-12-08
Dim fso As New FileSystemObject
Private Sub Command1_Click()
'Normal 0 Normal file. No attributes are set.
'ReadOnly 1 Read-only file. Attribute is read/write.
'Hidden 2 Hidden file. Attribute is read/write.
'System 4 System file. Attribute is read/write.
'Volume 8 Disk drive volume label. Attribute is read-only.
'Directory 16 Folder or directory. Attribute is read-only.
'Archive 32 File has changed since last backup. Attribute is read/write.
'Alias 64 Link or shortcut. Attribute is read-only.
'Compressed 128 Compressed file. Attribute is read-only.

Dim file1 As File
Set file1 = fso.GetFile("D:\AdobeWeb.log")

Dim i As Integer
i = file1.Attributes
Select Case i
Case 0
MsgBox "正常"
Case 1
MsgBox "只读"
Case 2
MsgBox "隐藏"
Case 4
MsgBox "系统"
Case 8
MsgBox "驱动器"
Case 16
MsgBox "文件夹"
Case 32
MsgBox "文档"
Case 64
MsgBox "快捷方式"
Case 128
MsgBox "压缩"
End Select

Set file1 = Nothing
Set fso = Nothing
End Sub
回复
sunfei4000 2003-12-08
如何得到文件(例:"C:\aa.txt")的若干信息:3.大小4.类型5.修改时间???
回复
sssoft 2003-12-08
直接用DIR就可以阿
回复
SoHo_Andy 2003-12-08
留个邮箱,发个例子给你
回复
发动态
发帖子
VB基础类
创建于2007-09-28

7451

社区成员

VB 基础类
申请成为版主
社区公告
暂无公告