Killsoft Sugdok

Temp file deleter

Go down

Temp file deleter

Post by Admin on Tue May 21, 2013 4:55 pm

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim files() As String = System.IO.Directory.GetFiles("C:\Windows\Temp", "*.*")
'Dim files1() As String = System.IO.Directory.GetFiles("C:\Users\Giovhz\AppData\Local\Temp", "*.*")
ListBox1.DataSource = files
Button2.Enabled = True
Catch

End Try

Try
If ListBox1.SelectedValue = 0 Then
MsgBox("No temp. file has detected!", MsgBoxStyle.OkOnly, "Done!")
Button2.Enabled = False
End If

Catch
Button2.Enabled = True
MsgBox("Scanning temp. file done!", MsgBoxStyle.OkOnly, "Done!")
End Try
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
tTemp.Start()
End Sub

Private Sub tTemp_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tTemp.Tick
Try
ListBox1.SelectedIndex += 1
System.IO.File.Delete(ListBox1.SelectedItem)
Catch
tTemp.Stop()
Button2.Enabled = False
MsgBox("Temp. file has been remove!", MsgBoxStyle.OkOnly, "Done!")

End Try

Try

System.IO.File.Delete(ListBox1.SelectedItem)

Dim files() As String = System.IO.Directory.GetFiles("C:\Windows\Temp", "*.*")
ListBox1.DataSource = files

Catch

End Try
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Text = My.User.Name & " C:\Windows\Temp"
End Sub
End Class


[You must be registered and logged in to see this link.]
avatar
Admin
Admin
Admin

Posts : 14
Join date : 2013-03-09

http://killsoft.1talk.net

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum