Click here to Skip to main content
15,501,984 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
David Mujica15-May-14 7:32
MemberDavid Mujica15-May-14 7:32 
AnswerRe: List(Of ObjectWithProperties) distinct property values Pin
Eddy Vluggen15-May-14 8:53
professionalEddy Vluggen15-May-14 8:53 
GeneralRe: List(Of ObjectWithProperties) distinct property values Pin
Johan Hakkesteegt15-May-14 21:16
MemberJohan Hakkesteegt15-May-14 21:16 
GeneralRe: List(Of ObjectWithProperties) distinct property values Pin
Mycroft Holmes15-May-14 23:41
professionalMycroft Holmes15-May-14 23:41 
QuestionWindow Service Does Not Stay "Alive" While Running Pin
ToolTimeTabor14-May-14 16:13
MemberToolTimeTabor14-May-14 16:13 
AnswerRe: Window Service Does Not Stay "Alive" While Running Pin
Bernhard Hiller14-May-14 22:51
MemberBernhard Hiller14-May-14 22:51 
AnswerRe: Window Service Does Not Stay "Alive" While Running Pin
Eddy Vluggen15-May-14 4:00
professionalEddy Vluggen15-May-14 4:00 
AnswerRe: Window Service Does Not Stay "Alive" While Running Pin
David Mujica15-May-14 7:25
MemberDavid Mujica15-May-14 7:25 
I have a very similar windows service that does exactly what you are describing.

VB
 ' Create a new FileSystemWatcher and set its properties.
       Dim watcher As New FileSystemWatcher()

       watcher.Path = gsWatcherPath

       ' Watch for changes in LastAccess and LastWrite times, and
       ' the renaming of files or directories.
       watcher.NotifyFilter = (NotifyFilters.LastAccess Or NotifyFilters.LastWrite Or NotifyFilters.FileName Or NotifyFilters.DirectoryName)
       ' Only watch text files.
       watcher.Filter = "*.txt"

       ' Add event handlers.
       AddHandler watcher.Created, AddressOf OnChanged

       ' Begin watching.
       watcher.EnableRaisingEvents = True


Private Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs)

       Call ProcessFile_Master(e.FullPath)

   End Sub


Once you instantiate the FileSystemWatcher, there is nothing else to do, no loops, nothing extra.

The Sub, OnChanged, gets fired for each file that is changed in the "watched" directory.

Hope this helps.
Thumbs Up | :thumbsup:
QuestionIf/and Statements Pin
David Rubin13-May-14 13:34
MemberDavid Rubin13-May-14 13:34 
AnswerRe: If/and Statements Pin
Peter Leow13-May-14 15:33
professionalPeter Leow13-May-14 15:33 
AnswerRe: If/and Statements Pin
charliedev14-May-14 20:20
Membercharliedev14-May-14 20:20 
Questionsave images as .gif Pin
khei-chan00712-May-14 18:44
Memberkhei-chan00712-May-14 18:44 
AnswerRe: save images as .gif Pin
Chris Quinn12-May-14 21:56
MemberChris Quinn12-May-14 21:56 
GeneralRe: save images as .gif Pin
khei-chan00712-May-14 22:25
Memberkhei-chan00712-May-14 22:25 
GeneralSaving Image as Gif Pin
I. Bandaranayake13-May-14 2:49
MemberI. Bandaranayake13-May-14 2:49 
AnswerRe: save images as .gif Pin
Richard MacCutchan12-May-14 23:47
mveRichard MacCutchan12-May-14 23:47 
QuestionMapWinGis project in Visual Basic.NET Pin
Member 1081056711-May-14 8:32
MemberMember 1081056711-May-14 8:32 
QuestionVB CODE TO RECEIVE SMS THROUGH GSM MODEM Pin
elly ianto10-May-14 3:34
Memberelly ianto10-May-14 3:34 
AnswerRe: VB CODE TO RECEIVE SMS THROUGH GSM MODEM Pin
Dave Kreskowiak10-May-14 4:38
mveDave Kreskowiak10-May-14 4:38 
GeneralRe: VB CODE TO RECEIVE SMS THROUGH GSM MODEM Pin
elly ianto12-May-14 4:24
Memberelly ianto12-May-14 4:24 
Questionentity framework too slow executing even a small query Pin
dilkonika9-May-14 15:11
Memberdilkonika9-May-14 15:11 
AnswerRe: entity framework too slow executing even a small query Pin
Dave Kreskowiak10-May-14 4:43
mveDave Kreskowiak10-May-14 4:43 
GeneralRe: entity framework too slow executing even a small query Pin
dilkonika10-May-14 9:49
Memberdilkonika10-May-14 9:49 
GeneralRe: entity framework too slow executing even a small query Pin
Dave Kreskowiak10-May-14 12:10
mveDave Kreskowiak10-May-14 12:10 
GeneralRe: entity framework too slow executing even a small query Pin
dilkonika11-May-14 6:45
Memberdilkonika11-May-14 6:45 

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.