VB CommonDialog

来源:百度知道 编辑:UC知道 时间:2024/05/10 19:08:47
用CommonDialog取得了路径该怎么打开文件呢!可不可以说详细点!我是菜鸟!呵!
像一些影音文件!

看看这个吧,我写的一个程序里面的,可以参考参考,呵呵

Private Sub Command1_Click()
Dim inputdata As String
CommonDialog1.Action = 1
File = CommonDialog1.FileName
If File = "" Then
MsgBox "没有选择文件!", vbOKOnly, "文件选择"
Text1.SetFocus
Exit Sub
Else
Open CommonDialog1.FileName For Input As #1
Do While Not EOF(1)
Line Input #1, inputdata
Text1.Text = Text1.Text + inputdata + vbCrLf
Loop
Close #1
End If
End Sub

晕倒 exe 就shell 其它的文件 直接就
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

直接引用一个windowsmediaplayer控件吧 然后赋给它的URL属性为文件路径即可

打开那类文件?