I've created a Windows service (VB.NET 2003). I've been installing/uninstalling/testing the service on my local PC. I've used the FileSystemWatcher to watch a directory on the C: drive. When a file lands in the watched directory, I create a new file in another location on the C: drive, and then archive the original file to yet another location on the C: drive. When testing is completed, I'll install the service on our test application server for further testing in the server environment before installing on the production server.
On my local PC the watched directory is the on the C: drive, etc. On the test server, I'll use the same directory structure, however the watched directory and all other directories (archive, etc.) will be on the D: drive, not C:.
I'm wondering what is the best way to do this. I'm new to Windows services and new to VB.NET for that matter. I'm not familiar with the configuration file. Is this where I'd specify this type of information, or do I have to hardcode these directory paths in the solution?
I've set the FileSystemWatcher Path property (in designtime) to watch the directory on the C: drive, and I'm wondering if there's a smooth way to set this path in runtime. Would I set it within the OnStart property of the service so the new Path property would be watched as soon as the service was started?
I suppose I could change the hard-coded directory paths to D: before installing on the test server, but this seems clunky. There must be a better way to accomplish this--I just don't know how to do it.
On my local PC the watched directory is the on the C: drive, etc. On the test server, I'll use the same directory structure, however the watched directory and all other directories (archive, etc.) will be on the D: drive, not C:.
I'm wondering what is the best way to do this. I'm new to Windows services and new to VB.NET for that matter. I'm not familiar with the configuration file. Is this where I'd specify this type of information, or do I have to hardcode these directory paths in the solution?
I've set the FileSystemWatcher Path property (in designtime) to watch the directory on the C: drive, and I'm wondering if there's a smooth way to set this path in runtime. Would I set it within the OnStart property of the service so the new Path property would be watched as soon as the service was started?
I suppose I could change the hard-coded directory paths to D: before installing on the test server, but this seems clunky. There must be a better way to accomplish this--I just don't know how to do it.