如何在App.Path中访问?
当我在 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
MkDir App.Path & "\users\" & Splice(2)
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
MkDir App.Path & "\users\" & Splice(2)
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
MkDir App.Path & "\users\" & Splice(2)
Open App.Path & "\users\" & Splice(2) & "\ipreglog.log" For Append As #1
Print #1, inip
Close #1
When I run this code in VB, the VB said me "Patch file access error". Can anybody help me? Here is my 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
MkDir App.Path & "\users\" & Splice(2)
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
MkDir App.Path & "\users\" & Splice(2)
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
MkDir App.Path & "\users\" & Splice(2)
Open App.Path & "\users\" & Splice(2) & "\ipreglog.log" For Append As #1
Print #1, inip
Close #1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您的进程没有创建目录的路径所需的权限?默认情况下,用户对 c:\Users 具有修改权限
。如果您未使用
以管理员身份运行
提升进程,您可能会在 Windows 7 上遇到此问题。对于 VB6 IDE 来说确实如此,并且默认情况下不会以管理员身份运行。I would suggest that your process doesn't have the necessary permissions on the path to create a directory? By default Users do have modify privileges on c:\Users
You can get this issue on Windows 7 if you haven't elevated your process using
Run As Administrator
. This is true for the VB6 IDE as well as this doesn't run as admin by default.如果您尝试创建 (MkDir) 已存在的目录,您将收到错误 75,路径/文件访问错误。您需要修改代码来检查该目录,并仅在该目录不存在时才创建它。
ETC。
If you try to create (MkDir) a directory that already exists you will get an error 75, Path/File access error. You need to modify your code to check for the directory and create it only if it does not exist.
etc.