VB6 获取桌面路径 存入变量 使用该变量报错
Private Sub Command1_Click()Dim a As String
Dim b As String
Dim d As String
Set obj = CreateObject("Wscript.shell") ' 方法- 获取桌面路径
k = obj.SpecialFolders.Item(10)
Dim kk As New IWshRuntimeLibrary.WshShell ’ 方法二获取桌面路径
a = kk.SpecialFolders("Desktop")
b = Chr(34) & a & Chr(34)
Text1.Text = b
Text2.Text = k
c = "C:\Users\HG\Desktop" ‘实际桌面路径
Open (b & "6.txt ") For Append As #1 ’ 变量b 提示路径不存在,c 则可以
有把变量b 放在Text1.text 读出,显示字符串和c 是一样的,请教是什么原因啊,谢谢!