简体   繁体   中英

How to create C# windows service app to run on multiple servers targeting a single folder checking for new files

I need to run an C# window service app on multiple servers to check a single folder for new files, if files found then process them or move them. Now if ServerA is processing the file, ServerB, ServerC should not process the same file.

I have created the app running on a single server but do not know how to achieve multi machine scenario.

Thanks for any help.

I usually just have a separat folder named something like "Processing". As soon as I identify what file to process, I move the file to the processing folder. That way, multiple treads accessing the primary folder, is not an issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM