主题:  打开外部文件的命令有哪些?谢谢

38692764

职务:普通成员
等级:1
金币:0.0
发贴:29
注册:2002/12/17 18:51:54
#12002/12/20 9:24:35
打开外部文件的命令有哪些?谢谢
刚刚学习 多多指教.



xcoming

职务:普通成员
等级:1
金币:0.0
发贴:10
注册:2002/1/18 13:05:48
#22002/12/20 17:15:36
--可根据文件扩展名,查找关联程序,以打开文件的行为库,COPY即可用
--请浏览:http://www.xcoming.com

--Open file with exe

property pFileName
property pFilePath
property pEvent

on mouseup me
if pEvent="mouseup" then fdoopen
end

on mousedown me
if pEvent="mousedown" then fdoopen
end

on mouseenter me
if pEvent="mouseenter" then fdoopen
end

on mouseleave me
if pEvent="mouseleave" then fdoopen
end

on fdoopen me
baRegister( "DiABLO [ORiON]" , 3157792 )

if pFilePath="windows path" then
pFilePath=baSysFolder( "windows" ) --读取系统目录
else if pFilePath="the moviepath" then
pFilePath=the moviepath
end if

if baFileExists(pFilePath & pFileName) then
tmp=baOpenFile( pFilePath & pFileName , "Normal" )
if tmp=31 then alert("没有找到关联文件!")

end if

end

on getpropertydescriptionlist me
act=["mousedown","mouseup","mouseenter","mouseleave"]
plist=[:]

plist.addprop (#pFileName,[#comment:"OpenFileName(include expand name):",#format:#string,#default:""])
plist.addprop (#pFilePath,[#comment:"OpenFilePath",#format:#string,#default:"windows path",#range:["windows path","the moviepath"]])
plist.addprop (#pEvent,[#comment:"触发事件:",#format:#string,#default:"mousedown",#range:act])

return plist
end