文件知识大汇聚
我们每天点来点去,在C、D、E、F盘中来回的穿越。好像在找什么东西似的。开始以为文件很神秘,不知道奇怪的文件从何方而来,见证奇迹的时刻到来了。
对驱动、目录和文件列表框编写的代码如下。
Private Sub Command1_Click(Index As Integer)
Select Case Index Case 0 File1.Pattern = "*.*" Case 1 File1.Pattern = "*.txt" Case 2 File1.Pattern = "*.jpg;*.bmp;*.tif" Case 3 File1.Pattern = "*.mp3;*.avi;*.wav;*.dat" End Select End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive End Sub
Private Sub Form_Load()
Dir1.Path = "c:windows" End Sub
显示文件路径名
Private Sub Dir1_Change()
File1.Path = Dir1.Path Label1.Caption = Dir1.Path End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive Label1.Caption = Drive1.Drive End Sub
Private Sub File1_Click()
If Right(Dir1.Path,1) = "" Then Label1.Caption = Dir1.Path & File1.FileName Else Label1.Caption = Dir1.Path & "" & File1.FileName End If End Sub
Private Sub Form_Load()
Dir1.Path = Drive1.Drive File1.FileName = Dir1.Path End Sub
调用系统文件
Private Sub Command1_Click(Index As Integer)
Dim x Select Case Index Case 0 x =Shell("D:qqQQProtectBinQQProtect.exe",1) Case 1 x = Shell("D:qqQQProtectBinQQProtect.exe",3) Case 2 x = Shell("D:qqQQProtectBinQQProtect.exe",3) Case 3 x = Shell("D:qqQQProtectBinQQProtect.exe",1) End Select End Sub
Private Sub Command2_Click() Private Sub Dir1_Change() Private Sub Drive1_Change() 文件的复制 Private Sub Command1_Click() Private Sub Dir1_Change() Private Sub Drive1_Change() Dir1.Path = Drive1.Drive End Sub (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |