求高手编一段VB程式,能够自动删除文件的程式,具体描述在问题补充那~
假设我的电脑D盘每天生成一个文件名为123的文件夹,现需要用VB编写一段程式,能够在每天晚上7点将这个文件夹包括文件夹内的东西都永久删除,求助各位高手啦~...
假设我的电脑D盘每天生成一个文件名为123的文件夹,现需要用VB编写一段程式,能够在每天晚上7点将这个文件夹包括文件夹内的东西都永久删除,求助各位高手啦~
展开
展开全部
窗体中放入一个Timer1控件:
Private Sub Form_Load()
Timer1.Interval = 60000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If Hour(Now) = 19 And Minute(Now) = 0 And Dir("d:\123", vbDirectory) <> "" Then CreateObject("Scripting.FileSystemObject").Getfolder("d:\123").Delete True
End Sub
Private Sub Form_Load()
Timer1.Interval = 60000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If Hour(Now) = 19 And Minute(Now) = 0 And Dir("d:\123", vbDirectory) <> "" Then CreateObject("Scripting.FileSystemObject").Getfolder("d:\123").Delete True
End Sub
展开全部
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Location = New Point(-3000, -300) '用作影藏窗体
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Hour(Now()) = 19 Then
My.Computer.FileSystem.DeleteDirectory("d:\123", FileIO.DeleteDirectoryOption.DeleteAllContents, FileIO.RecycleOption.DeletePermanently)
Me.Close()
End If
End Sub
End Class
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Location = New Point(-3000, -300) '用作影藏窗体
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Hour(Now()) = 19 Then
My.Computer.FileSystem.DeleteDirectory("d:\123", FileIO.DeleteDirectoryOption.DeleteAllContents, FileIO.RecycleOption.DeletePermanently)
Me.Close()
End If
End Sub
End Class
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这个问题如无意外应该或者可能未必一定不排除这个可能性百分之零点三三三三三的机会……是不知道的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询