Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Basic as a service

Status
Not open for further replies.

dkwaters

Programmer
Feb 16, 2003
17
0
0
GB
Hi,

I need to set up a visual basic program that is connected to a FTP site, as soon as a file appears on the FTP site the program needs to download it. Ideally I would like this running all the time in the background and would assume it needs to be a service, therefore I have the following questions.

1. How do you set a visual basic program up as a service?
2. How do you alert this servcie to run the code copying the file as soon as the file appears on the FTP site?

thanks in advance
 
I am not sure how to set the program up to be a service though you might be able to just set it up to just start up when the computer starts by putting the program in the startup folder

One way to have it continually check for the file is to set up a module. In that module you would set up a timer. Set the timer for the amount of time you would like elapsed between checking. Once it finds that file it can drop out of that code and copy the file over then delete the file. After it copies the file it can go back to the timer code.

Cretin
 
Do you mean use a loop, would this be quite resource intensive?
 
I need to do something similar:

1. Run vb prog as a service
2. When time reaches a specified time (e.g. 12:43 pm), play a file.

I too would like to know how to run a prog as a service (with a little icon in the task bar so that a user can always close the prog if they desire).

Thanks
 
Do a keyword search on "service". This topic has been covered many times, with at least two reasonable solutions to the problem.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
I wanted to do the same thing, I found some code on the net that allowed me to write a true service, with threading, just like a service is supposed to be. Check out the code here

I'm using it and it works great!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top