如何在vb中用dir命令打开某个文件夹?详细例子!!

xiaoyi1979 2003-09-12 10:56:17
如何在vb中用dir命令打开某个文件夹?详细例子!!
...全文
421 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
tanyx 2003-09-13
  • 打赏
  • 举报
回复
漂亮,这是程序员。
CrazyHosptial 2003-09-13
  • 打赏
  • 举报
回复
不用那么麻烦的.....
这样:例如你准备打开d:\吧....
Private Sub Command1_Click()
Shell "Explorer /s, D:\"
End Sub
jonia 2003-09-12
  • 打赏
  • 举报
回复
比如
文件夹c:\jonia文件夹
我点击按钮就能把把文件夹的窗体在打开
相当于在WINDOWS下的双击文件夹操作
  • 打赏
  • 举报
回复
不太明白楼主想问什么?

UP
射天狼 2003-09-12
  • 打赏
  • 举报
回复
如果是设置当前文件夹,可以用
ChDir "D:\aa"
射天狼 2003-09-12
  • 打赏
  • 举报
回复
打开文件夹,什么意思~~
jinesc 2003-09-12
  • 打赏
  • 举报
回复
On Error Resume Next
Dim MyName
MyName = Dir(App.Path & "\PIC\*.jpg")
Do While MyName <> "" ' 开始循环。

List1.AddItem App.Path & "\PIC\" & MyName
MyName = Dir '(App.Path & "\PIC\*.jpg")
Loop
Dim MyValue
If List1.ListCount > 0 Then
Randomize
MyValue = Int((List1.ListCount * Rnd) + 1)
Me.Picture = LoadPicture(List1.List(MyValue - 1))
End If
northwolves 2003-09-12
  • 打赏
  • 举报
回复
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
Sub opendir(ByVal dirpath As String)
ShellExecute hwnd, "open", dirpath, vbNullString, vbNullString, 5
End Sub
Private Sub Command1_Click()
Call opendir("c:\jonia")
End Sub

7,789

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧