vb控件操作文件

来源:互联网 发布:物联网如何传输数据 编辑:程序博客网 时间:2024/05/18 15:08

代码如下:

Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_DblClick()
    If Right(File1.Path, 1) <> "\" Then
        Text2.Text = File1.Path & "\" & File1.FileName
    Else
        Text2.Text = File1.Path & File1.FileName
    End If
End Sub

Private Sub Form_Load()
File1.Pattern = "*.*"
Text1.Text = "*.*"
End Sub

 

原创粉丝点击