Option Explicit
Dim path As String * 255
Private Declare Function GetCurrentDirectoryA Lib "kernel32" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As LongPrivate Sub Form_Load()
Dim i As String
i = GetCurrentDirectoryA(Len(path), path)
path = path & "\config.txt"
MsgBox path
End Sub
msgbox里怎么显示不出来\config.txt,而只显示当前路径,拜托
Dim path As String * 255
Private Declare Function GetCurrentDirectoryA Lib "kernel32" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As LongPrivate Sub Form_Load()
Dim i As String
i = GetCurrentDirectoryA(Len(path), path)
path = path & "\config.txt"
MsgBox path
End Sub
msgbox里怎么显示不出来\config.txt,而只显示当前路径,拜托
将path = path & "\config.txt"
MsgBox path
改为
MsgBox path & "\config.txt"
Dim path As String * 255
Private Declare Function GetCurrentDirectoryA Lib "kernel32" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As LongPrivate Sub Form_Load()
path = Left$(path, GetCurrentDirectoryA(Len(path), path)) & "\config.txt"
MsgBox RTrim$(path)
End Sub
Dim path As String * 255
Private Declare Function GetCurrentDirectoryA Lib "kernel32" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As LongPrivate Sub Form_Load()
Dim i As Long
i = GetCurrentDirectoryA(Len(path), path)
path = Left(path, Instr(1, path, chr(0)) -1) & "\config.txt"
MsgBox path
End Sub