10 Years of Service
64%
Please note, if you want to make a deal with this user, that it is blocked.
Code:
Imports System.Threading
Imports System.IO
Public Class Form1
Dim xCaminhoFolder As String = My.Computer.FileSystem.SpecialDirectories.Desktop
Dim xNovaThread As Thread
Dim xListaCoy As ListBox
Dim xBlackList As String = Nothing
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
xVerificaArquivosInicio()
End Sub
Sub xVerificaArquivosInicio()
Dim xArquivos() As String = Directory.GetFiles(xCaminhoFolder)
Dim xPastas() As String = Directory.GetDirectories(xCaminhoFolder)
For Each xFiles As String In xArquivos
xBlackList += xFiles & vbNewLine
Next
For Each xPastinhas As String In xPastas
xBlackList += xPastinhas & vbNewLine
Next
xNovaThread = New Thread(AddressOf xVerificaArquivos)
xNovaThread.Start()
End Sub
Sub xVerificaArquivos()
Do
Dim xArquivos() As String = Directory.GetFiles(xCaminhoFolder)
Dim xPastas() As String = Directory.GetDirectories(xCaminhoFolder)
For Each xFiles As String In xArquivos
If Not xBlackList.Contains(xFiles) Then
MsgBox("Arquivo: " & xFiles)
xBlackList += xFiles & vbNewLine
End If
Next
For Each xPastinhas As String In xPastas
If Not xBlackList.Contains(xPastinhas) Then
MsgBox("Pasta: " & xPastinhas)
xBlackList += xPastinhas & vbNewLine
End If
Next
Thread.CurrentThread.Sleep(500)
Loop
End Sub
End Class
I did it for fun.
Checks if any files or folders were created on the desktop.
The folder path to be monitored can be changed.
Checks if any files or folders were created on the desktop.
The folder path to be monitored can be changed.