注册 登录
编程论坛 VFP论坛

分享:取得文件或文件夹的相关属性,分辩率,视频时长,等等几百个属性明细

zhken 发布于 2022-08-07 11:05, 1552 次点击
近日看到一段VB,关于取得视频时长等等,动手弄了一下,竞能在vfp下很好运行,功能强大,不足处望指正


CLEAR
CREATE CURSOR temp000000443(序号 N(6),名称 C(30),参数 C(60))
objSHELL = CreateObject("Shell.Application")
objPath = objSHELL.NameSpace('H:\')
objFile = objPath.ParseName('1.jpg')  &&如果是文件夹H:\1 则为1
For i = 0 To 350 &&最大值可能更大
mingcheng = objPath.GetDetailsOf(objFile, i)
canshi=objPath.GetDetailsOf(,i)  &&或 canshi=objPath.GetDetailsOf('item',i)
APPEND BLANK
REPLACE 序号 WITH I
REPLACE 参数 WITH mingcheng , 名称 WITH canshi
ENDFOR
GO top
BROWSE
9 回复
#2
schtg2022-08-07 12:48
回复 楼主 zhken
谢谢分享!
#3
laowan0012022-08-07 17:05
#4
wxzd1232022-08-07 19:27
#5
nbwww2022-08-07 21:49
#6
my23182022-08-08 07:33
#7
cjc10102022-08-08 08:09
#8
liunis2022-08-08 12:43
完美,针对各种类型的文件属都有很好的解析。
#9
sych2022-08-10 10:35
侠义之人,分享快乐
#10
sdta2024-02-26 14:28
名称和参数结果是一样的
1