主题:  打开光盘里的所有目录

afid

职务:普通成员
等级:1
金币:0.0
发贴:3
注册:2001/9/15 21:48:36
#12001/9/29 14:34:00
我制作了一个Project.exe(打包)文件.我把此打包文件刻录在光盘里.
运行Project.exe节目,节目内有一个按钮,当用户单击此按钮即可
打开当前光盘里的所有目录(因为用户的光盘盘符具有不确定性,每台机器都不一样,
有的光盘是E:盘,有的光盘是H:盘.谢谢

----打开硬盘里的内容我会.其代码是:
on mouseUp
open "explorer c:\Program Files\"
end
请各位高手有空帮我.谢谢!



littleboy_5d

职务:普通成员
等级:1
金币:0.0
发贴:104
注册:2000/11/13 16:05:12
#22001/9/30 9:23:44
你的Project.exe在光盤上運行的話(the pathname).char[1..3]就是光盤的路徑.



donlee

职务:普通成员
等级:1
金币:1.0
发贴:271
注册:2000/12/8 8:52:18
#32001/9/30 20:14:18
这里主要的问题是判断出光盘的盘符,可以查一下过去的帖子,莫特探员和我都讨论过,用fileio、或filextra来完成。



陈蕊

职务:普通成员
等级:1
金币:0.0
发贴:20
注册:2001/9/20 15:15:09
#42001/9/30 21:42:30
Gotonetpage "@/目录名 "



我就是我

职务:版主
等级:6
金币:14.0
发贴:5466
注册:2004/1/13 17:02:03
#52001/10/1 11:09:16
on startMovie
global myCD
put CheckDrive("weirdfil.txt") into myCD
end

on CheckDrive weirdfile
repeat with i = 67 to 90
set drive = numTochar( i )
set thisPath = string(drive & ":\"& weirdfile)
set myFile = new(xtra "FileIo") -- Create an instance of FileIO Xtra
openFile(myFile, thisPath, 1) -- attempt to open the file
if status(myfile) = 0 then -- status returns 0 for success
set myFile = 0 -- Dispose of the instance
return drive&":"
exit
end if
end repeat
set myFile = 0 -- Dispose of the instance
alert "Please check that the file named '" & weirdfile & "' is on your CD drive."
end
然后在你所要找得盘符下放入“weirdfile.txt"文件就可以 判断盘符最后在你调用的时候加入
global myCD
put CheckDrive("weirdfil.txt")
就可以了

编辑历史:[这消息被fei编辑过(编辑时间2001-10-01 11:10:40)]
[这消息被5D大叔编辑过(编辑时间2001-10-01 12:15:12)]