如何使用 App.Path
好吧,我用 VB6 编写了这些代码,但是当我运行它时,Vb 说我找不到路径,任何人都可以帮助我,这是我的 VB 代码:
MkDir App.Path & "\users\" & Splice(2)
Open App.Path & "\users\" & Splice(2) & "\pass.txt" For Append As #1
Print #1, Splice(3)
Close #1
Open App.Path & "\users\" & Splice(2) & "\list.txt" For Append As #1
Print #1, "" 'we have to put something into the buddy list
'so well put nothing ;)
Close #1
Open App.Path & "\users\" & Splice(2) & "\info.txt" For Append As #1
Print #1, "" 'we have to put something into the buddy list
'so well put nothing ;)
Close #1
Open App.Path & "\ipreglog.log" For Append As #1
Print #1, inip
Close #1
谢谢
Well i made these code in VB6 but when i run it , the Vb said me Path not found , can anyone help me, here is my VB code:
MkDir App.Path & "\users\" & Splice(2)
Open App.Path & "\users\" & Splice(2) & "\pass.txt" For Append As #1
Print #1, Splice(3)
Close #1
Open App.Path & "\users\" & Splice(2) & "\list.txt" For Append As #1
Print #1, "" 'we have to put something into the buddy list
'so well put nothing ;)
Close #1
Open App.Path & "\users\" & Splice(2) & "\info.txt" For Append As #1
Print #1, "" 'we have to put something into the buddy list
'so well put nothing ;)
Close #1
Open App.Path & "\ipreglog.log" For Append As #1
Print #1, inip
Close #1
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MkDir 不是递归的,因此它需要直接父级存在。
尝试首先确保 Users 目录存在:
MkDir is not recursive so it requires the immediate parent to exist.
Try ensuring that the Users directory exists first:
嗯,可能该路径不存在。您需要进一步调查才能找到确切的问题。
一个。检查路径名中是否有空格。
b.检查所有目录是否存在。 MkDir 一次只创建一个目录,它要求直接父目录存在(正如 Deanna 所说)。
您正在写入 App.Path 下的文件。注意程序虚拟化文件。 Windows 通过秘密写入虚拟文件夹来阻止程序写入
Program Files
及其子目录。Erm, probably the path does not exist. You need to investigate further to find the exact problem.
a. Check for spaces in the pathname.
b. Check that all the directories exist. MkDir only makes one directory at a time, it requires the immediate parent to exist (as Deanna says).
You are writing to files underneath App.Path. Watch out for virtualisation of Program Files. Windows prevents programs from writing to
Program Files
and its subdirectories by secretly writing to a virtual folder instead.