标题: 为什么运行时提示没有权限?请高手指教 [打印本页] 作者: donkey0702 时间: 2007-7-5 18:11 标题: 为什么运行时提示没有权限?请高手指教 Declare Sub createfile()
Sub main
Dim filemode as Integer
Dim attrib as Integer
Call createfile
attrib=1
filemode=FileAttr(1,attrib)
If filemode=1 or 2 then
MsgBox "File was left open. Closing now."
Close #1
End If
Kill "C:\TEMP001"
End Sub
Sub createfile()
Rem Put the numbers 1-10 into a file
Dim x as Integer
Open "C:\TEMP001" for Output as #1
For x=1 to 10
Write #1, x
Next x
End Sub
当程序运行到Open "C:\TEMP001" for Output as #1时就有提示说"Permision Denied", 有高手可以指导一下吗?万分感激作者: 5am 时间: 2007-7-6 09:32
当前登陆用户权限问题??作者: donkey0702 时间: 2007-7-6 14:12 标题: 回复 #2 5am 的帖子 可是如果只是运行
Sub main
Rem Put the numbers 1-10 into a file
Dim x as Integer
Open "C:\TEMP001" for Output as #1
For x=1 to 10
Write #1, x
Next x
End Sub
是可以把数据输入文件中的, 只有全部代码一起运行的情况下会发生这种情况.
而且文件关闭的情况下反而会输出"File was left open. Closing now."