i face a problem in checking file condition.
I wish to create a program that can check the condition file continuously while the program is running.
For code below that I wrote:
Private Sub StartTracking_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim FILE_NAME As String = "\Program Files\Fast_Automatic_Accident_Notification_Through_SMS\Resources\contact4.txt"
If System.IO.File.Exists(FILE_NAME) = True Then
MessageBox.Show("File already Exist")
ElseIf MessageBox.Show("File not Exist") Then
End If
End Sub
It just can check the file condition only once, that this is only the program first load.
If I suddenly remove the file, it can’t show a message “ File not Exist” or if I suddenly receive a file and place at the folder, it can’t show me a message “File already Exist”
Kindly advice, How can I modify my code to continuously checking the file condition while the program is running.
thanks a lot.