Call GetCurrentDirectoryA(256, curdir)
Dim a, s As String
Dim curdir As String
curdir = Space(256)
Call GetCurrentDirectoryA(256, curdir)
a = curdir
s = "\d.bmp "
a = a & s
Text1.Text = a
我想的是a= "f:\123\d.bmp "
可是a = "f:\123 "
错在哪里了.
[解决办法]
Dim a, s As String
Dim curdir As String
dim length as long
curdir = Space(256)
length= GetCurrentDirectoryA(256, curdir)
a = left(curdir ,length-1)
s = "\d.bmp "
a = a & s
Text1.Text = a