Click here to Skip to main content
15,890,882 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionProblem in passing arguments to cmd prompt from VB program Pin
Member 109935298-Aug-14 7:33
Member 109935298-Aug-14 7:33 
AnswerRe: Problem in passing arguments to cmd prompt from VB program Pin
Wombaticus8-Aug-14 8:27
Wombaticus8-Aug-14 8:27 
GeneralRe: Problem in passing arguments to cmd prompt from VB program Pin
Member 109935298-Aug-14 23:34
Member 109935298-Aug-14 23:34 
AnswerRe: Problem in passing arguments to cmd prompt from VB program Pin
Mike Meinz5-Sep-14 7:50
Mike Meinz5-Sep-14 7:50 
QuestionTorrent dowloader in VB.NET Pin
Member 110001467-Aug-14 23:48
Member 110001467-Aug-14 23:48 
AnswerRe: Torrent dowloader in VB.NET Pin
Dave Kreskowiak8-Aug-14 4:24
mveDave Kreskowiak8-Aug-14 4:24 
AnswerRe: Torrent dowloader in VB.NET Pin
ZurdoDev15-Aug-14 8:18
professionalZurdoDev15-Aug-14 8:18 
QuestionProblem instantiating FileSystemWatcher in Windows Service Pin
Member 109911324-Aug-14 9:24
Member 109911324-Aug-14 9:24 
I created a windows service to monitor a directory and import any files that are created there. I can see from the eventviewer that the FileSystemWatcher must not be instantiated properly because it errors on the line where I try to assign the directory to be watched to the filesystemwatcher.

Imports System.IO
Imports System.Diagnostics

Public Class PPLabImportService

Private WithEvents _fsWatcher As FileSystemWatcher

Protected Overrides Sub OnStart(ByVal args() As String)
_fsWatcher = New FileSystemWatcher
Dim strDir As String =
System.Configuration.ConfigurationManager.AppSettings
("ImportDirPath")
_fsWatcher.Path = strDir


I have confirmed that strDir has a valid string value, but that last line always throws a nullException error as if it doesn't know what _fsWatcher is.

This code worked perfectly fine as a windows form app. It is only the windows service version that doesn't seem to work.

Could someone please point out the probably bonehead error I am making in declaring the FileSystemWatcher?
AnswerRe: Problem instantiating FileSystemWatcher in Windows Service Pin
David Mujica4-Aug-14 10:56
David Mujica4-Aug-14 10:56 
GeneralRe: Problem instantiating FileSystemWatcher in Windows Service Pin
Member 109911324-Aug-14 11:04
Member 109911324-Aug-14 11:04 
AnswerRe: Problem instantiating FileSystemWatcher in Windows Service Pin
Bernhard Hiller4-Aug-14 21:04
Bernhard Hiller4-Aug-14 21:04 
GeneralRe: Problem instantiating FileSystemWatcher in Windows Service Pin
Member 109911325-Aug-14 2:55
Member 109911325-Aug-14 2:55 
GeneralRe: Problem instantiating FileSystemWatcher in Windows Service Pin
Bernhard Hiller5-Aug-14 20:09
Bernhard Hiller5-Aug-14 20:09 
QuestionRegular Expression in VBS Pin
Member 88781863-Aug-14 19:36
Member 88781863-Aug-14 19:36 
GeneralRe: Regular Expression in VBS Pin
Tim Carmichael4-Aug-14 2:43
Tim Carmichael4-Aug-14 2:43 
QuestionRe: Regular Expression in VBS Pin
ZurdoDev15-Aug-14 8:19
professionalZurdoDev15-Aug-14 8:19 
QuestionProblem setting a value in a textbox from another form Pin
dilkonika2-Aug-14 6:08
dilkonika2-Aug-14 6:08 
AnswerRe: Problem setting a value in a textbox from another form Pin
Richard Andrew x642-Aug-14 16:14
professionalRichard Andrew x642-Aug-14 16:14 
AnswerRe: Problem setting a value in a textbox from another form Pin
kasbaba2-Aug-14 19:57
kasbaba2-Aug-14 19:57 
Questionsherdian controls : license not found Pin
zuber ahmed2-Aug-14 1:39
zuber ahmed2-Aug-14 1:39 
AnswerRe: sherdian controls : license not found Pin
Eddy Vluggen2-Aug-14 12:23
professionalEddy Vluggen2-Aug-14 12:23 
QuestionSherdian controls Pin
zuber ahmed1-Aug-14 10:00
zuber ahmed1-Aug-14 10:00 
AnswerRe: Sherdian controls Pin
Mycroft Holmes1-Aug-14 13:43
professionalMycroft Holmes1-Aug-14 13:43 
AnswerRe: Sherdian controls Pin
ZurdoDev15-Aug-14 8:19
professionalZurdoDev15-Aug-14 8:19 
GeneralRe: Sherdian controls Pin
zuber ahmed16-Aug-14 2:11
zuber ahmed16-Aug-14 2:11 

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.