vb 程序所在文件夹路径?

来源:百度知道 编辑:UC知道 时间:2024/06/16 00:29:01
比如说程序所在文件夹下面的1.txt
App.Path & "\1.txt"

那么程序所在文件夹下面还有个 aaa 文件夹中的1.txt 怎么表示
为什么楼下2个答案,都显示"缺少表达式"

那你用个变量来接收吧,比如
dim s as string
s = app.path &"\aaa\1.txt"
msgobx s

sPath = replace(app.path & "\aaa\1.txt","\\","\")
这样写的好处是如果程序在根目录就不会出错了

App.path & "\" & aaa "\" & 1.txt

App.path & "\ aaa \ 1.txt "