Click here to Skip to main content
15,888,968 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Can anyone Direct me to how to change Windows 'Settings' programmatically? Pin
Richard Deeming18-Jul-18 7:34
mveRichard Deeming18-Jul-18 7:34 
GeneralRe: Can anyone Direct me to how to change Windows 'Settings' programmatically? Pin
Member 331739318-Jul-18 8:06
Member 331739318-Jul-18 8:06 
GeneralRe: Can anyone Direct me to how to change Windows 'Settings' programmatically? Pin
Richard Deeming18-Jul-18 8:21
mveRichard Deeming18-Jul-18 8:21 
GeneralRe: Can anyone Direct me to how to change Windows 'Settings' programmatically? Pin
Randor 18-Jul-18 15:02
professional Randor 18-Jul-18 15:02 
GeneralRe: Can anyone Direct me to how to change Windows 'Settings' programmatically? Pin
Dave Kreskowiak18-Jul-18 10:37
mveDave Kreskowiak18-Jul-18 10:37 
GeneralRe: Can anyone Direct me to how to change Windows 'Settings' programmatically? Pin
Member 331739318-Jul-18 11:29
Member 331739318-Jul-18 11:29 
GeneralRe: Can anyone Direct me to how to change Windows 'Settings' programmatically? Pin
Mycroft Holmes18-Jul-18 14:16
professionalMycroft Holmes18-Jul-18 14:16 
QuestionUSING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Member 1390609010-Jul-18 22:55
Member 1390609010-Jul-18 22:55 
I am developing a program in vb.net to monitor and keep a record of all copied files using the fswatcher class. The program runs well without any bug but gives not output after running.
please help, this is what I have tried.

Imports System.IO
Imports System.Diagnostics
Public Class Form1
Public watchfolder As FileSystemWatcher
Dim watchers As FileSystemWatcher()

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btn_startwatch.Click
watchfolder = New System.IO.FileSystemWatcher()
Dim drives As String() = System.IO.Directory.GetLogicalDrives()
watchers = New FileSystemWatcher(drives.Length - 1) {}
Dim i As Integer = 0
For Each strDrive As String In drives
Dim df As New DriveInfo(strDrive)
If Not df.IsReady Then
Continue For
End If
watchfolder.Path = strDrive
watchfolder.NotifyFilter = IO.NotifyFilters.DirectoryName
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.FileName
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.Attributes
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.CreationTime
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.LastAccess
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.Security
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.LastWrite
watchfolder.NotifyFilter = watchfolder.NotifyFilter Or IO.NotifyFilters.Size
AddHandler watchfolder.Changed, AddressOf logchange
AddHandler watchfolder.Created, AddressOf logchange
AddHandler watchfolder.Deleted, AddressOf logchange
AddHandler watchfolder.Renamed, AddressOf logrename

watchfolder.EnableRaisingEvents = True
btn_startwatch.Enabled = False
btn_stop.enabled = True


Next
End Sub
Private Sub logchange(ByVal source As Object, ByVal e As System.IO.FileSystemEventArgs)
If e.ChangeType = IO.WatcherChangeTypes.Changed Then
folderactivity.Text &= "file" & e.FullPath & "has been modified" & vbCrLf
End If
If e.ChangeType = IO.WatcherChangeTypes.Created Then
folderactivity.Text &= "file" & e.FullPath & "has been created" & vbCrLf
End If
If e.ChangeType = IO.WatcherChangeTypes.Deleted Then
folderactivity.Text &= "file" & e.FullPath & "has been deleted" & vbCrLf
End If

End Sub
Private Sub logrename(ByVal source As Object, ByVal e As System.IO.RenamedEventArgs)

folderactivity.Text &= "file" & e.OldName & "has been renamed to" & e.Name & vbCrLf

End Sub

Private Sub btn_stop_Click(sender As Object, e As EventArgs) Handles btn_stop.Click
watchfolder.EnableRaisingEvents = False
btn_startwatch.Enabled = True
btn_stop.Enabled = False
End Sub
End Class
AnswerRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Jochen Arndt10-Jul-18 23:49
professionalJochen Arndt10-Jul-18 23:49 
GeneralRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Member 1390609011-Jul-18 0:15
Member 1390609011-Jul-18 0:15 
GeneralRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Jochen Arndt11-Jul-18 0:35
professionalJochen Arndt11-Jul-18 0:35 
GeneralRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Member 1390609011-Jul-18 4:07
Member 1390609011-Jul-18 4:07 
GeneralRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Jochen Arndt11-Jul-18 7:06
professionalJochen Arndt11-Jul-18 7:06 
AnswerRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Dave Kreskowiak11-Jul-18 3:18
mveDave Kreskowiak11-Jul-18 3:18 
GeneralRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Member 1390609011-Jul-18 4:06
Member 1390609011-Jul-18 4:06 
GeneralRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Dave Kreskowiak11-Jul-18 5:14
mveDave Kreskowiak11-Jul-18 5:14 
AnswerRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
mo149211-Jul-18 5:55
mo149211-Jul-18 5:55 
GeneralRe: USING FSWATCHER TO MONITOR FILES COPIED TO ALL EXTERNAL DRIVES Pin
Eddy Vluggen13-Jul-18 0:51
professionalEddy Vluggen13-Jul-18 0:51 
QuestionVisual Basic Codes 6.0 Pin
Asheeledio5-Jul-18 23:32
Asheeledio5-Jul-18 23:32 
AnswerRe: Visual Basic Codes 6.0 Pin
Richard MacCutchan5-Jul-18 23:36
mveRichard MacCutchan5-Jul-18 23:36 
AnswerRe: Visual Basic Codes 6.0 Pin
Chris Quinn5-Jul-18 23:41
Chris Quinn5-Jul-18 23:41 
AnswerRe: Visual Basic Codes 6.0 Pin
Dave Kreskowiak6-Jul-18 13:48
mveDave Kreskowiak6-Jul-18 13:48 
Questioncan't connect to finger print scanning device from windows server 2003 Pin
Meax5-Jul-18 0:36
Meax5-Jul-18 0:36 
AnswerRe: can't connect to finger print scanning device from windows server 2003 Pin
Richard Deeming5-Jul-18 1:38
mveRichard Deeming5-Jul-18 1:38 
GeneralRe: can't connect to finger print scanning device from windows server 2003 Pin
Meax5-Jul-18 8:06
Meax5-Jul-18 8:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.