4个回答
展开全部
如果你是想要打开C:\123.txt文件
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 Const SW_NORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, "open", C:\123.txt, vbNullString, vbNullString, 1 'c:\123.txt可以换成你想要打开的文件就行..什么格式的文件就自动用相应的程序打开了
End Sub
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 Const SW_NORMAL = 1
Private Sub Command1_Click()
ShellExecute Me.hwnd, "open", C:\123.txt, vbNullString, vbNullString, 1 'c:\123.txt可以换成你想要打开的文件就行..什么格式的文件就自动用相应的程序打开了
End Sub
展开全部
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
ShellExecute 0,"Open",<你的文件>,"","",1
=========================
这个代码不论是exe还是txt,只要在资源管理器中能显示有图标的文件都能打开
(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
ShellExecute 0,"Open",<你的文件>,"","",1
=========================
这个代码不论是exe还是txt,只要在资源管理器中能显示有图标的文件都能打开
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
代码关键字好像是shell。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
呵呵,不会是拿来使用在不良目的上啊?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询