vb6.0怎么打开跟程序在同一个目录下的文件夹?
按刚才的方法做了,在我电脑能打开,在其他电脑也能打开,可是刻在光盘上就不行了,在光盘上打开的文件夹就变了,这是什么问题啊?OptionExplicitPrivateDec...
按刚才的方法做了,在我电脑能打开,在其他电脑也能打开,可是刻在光盘上就不行了,在光盘上打开的文件夹就变了,这是什么问题啊?
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal _
lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As _
String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Call ShellExecute(0, "Open", "explorer.exe", App.Path & "\mulujia", vbNullString, 1)
End Sub
求大神帮帮忙,我没财富值了, 展开
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias _
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal _
lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As _
String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
Call ShellExecute(0, "Open", "explorer.exe", App.Path & "\mulujia", vbNullString, 1)
End Sub
求大神帮帮忙,我没财富值了, 展开
1个回答
展开全部
光盘和硬盘不一样,你多了一"\"
改成
Call ShellExecute(0, "Open", "explorer.exe", App.Path & "mulujia", vbNullString, 1)
或
Call ShellExecute(0, "Open", "explorer.exe", iif(len(app.path)>3,app.path & "\",app.path) & "mulujia", vbNullString, 1)
就可以了。
请采纳!谢谢!
改成
Call ShellExecute(0, "Open", "explorer.exe", App.Path & "mulujia", vbNullString, 1)
或
Call ShellExecute(0, "Open", "explorer.exe", iif(len(app.path)>3,app.path & "\",app.path) & "mulujia", vbNullString, 1)
就可以了。
请采纳!谢谢!
追问
那把"\" 弄掉电脑上就不行了啊?这怎么弄呢?没有两全其美的啊?
追答
Call ShellExecute(0, "Open", "explorer.exe", iif(len(app.path)>3,app.path & "\",app.path) & "mulujia", vbNullString, 1)
这个硬盘和光盘都可以用。
请采纳!谢谢!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询