文件知识大汇聚

文件知识大汇聚,第1张

概述       我们每天点来点去,在C、D、E、F盘中来回的穿越。好像在找什么东西似的。开始以为文件很神秘,不知道奇怪的文件从何方而来,见证奇迹的时刻到来了。   对驱动、目录和文件列表框编写的代码如下。   Private Sub Command1_Click(Index As Integer)     Select Case Index         Case 0             Fi

我们每天点来点去,在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:\qq\QQProtect\Bin\QQProtect.exe",1)
Case 1
x = Shell("D:\qq\QQProtect\Bin\QQProtect.exe",3)
Case 2
x = Shell("D:\qq\QQProtect\Bin\QQProtect.exe",3)
Case 3
x = Shell("D:\qq\QQProtect\Bin\QQProtect.exe",1)
End Select
End Sub



Private Sub Command1_Click()
Dim killedfile As String,xuanzhe As String
Dim x
If Right(Dir1.Path,1) = "\" Then
xuanzhe = Dir1.Path & file1.filename
Else
xuanzhe = Dir1.Path & "\" & file1.filename
End If
killedfile = xuanzhe
x = MsgBox("你确认你删除文件吗?",35,"确认框")
If x = 6 Then
Kill killedfile
MsgBox "确认已删除!"
End If
End Sub

Private Sub Command2_Click()
End
End Sub

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

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

文件的复制

Private Sub Command1_Click()
Dim yuanfile As String,mufile As String
If Right(Dir1.Path,1) = "\" Then
yuanfile = Dir1.Path & file1.Path
Else
yuanfile = Dir1.Path & "\" & file1.Path
End If
mufile = inputBox("请输入要复制的目的文件","请输入")
If mufile <> "" Then
filecopy yuanfile,mufile
MsgBox "复制成功"
End If

End Sub

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

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

总结

以上是内存溢出为你收集整理的文件知识汇聚全部内容,希望文章能够帮你解决文件知识大汇聚所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1279582.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)