简体   繁体   English

如何创建 C# windows 服务应用程序以在针对单个文件夹检查新文件的多个服务器上运行

[英]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.我需要在多台服务器上运行 C# window 服务应用程序来检查单个文件夹中是否有新文件,如果找到文件则处理它们或移动它们。 Now if ServerA is processing the file, ServerB, ServerC should not process the same file.现在如果 ServerA 正在处理文件,ServerB、ServerC 不应该处理同一个文件。

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.这样,多个线程访问主文件夹就不是问题了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以创建ac#应用程序以从多个wcf服务器下载单个文件? - is it possible to create a c# app to download a single file from multiple wcf servers? C#Windows服务多个配置文件 - C# Windows Service Multiple Config Files 如何将控制台应用程序作为Windows服务运行? 我对MS默认提供的“ ClickOnce”文件感到困惑(VS 2008,C#) - How to run a console app as a windows service? I'm getting confused by the “ClickOnce” files MS gives by default (VS 2008, C#) 通过Windows应用程序检查远程文件夹上的文件 - Checking files on a remote folder through Windows app 如何在C#中创建可以与GUI *或*一起运行的Windows应用程序? - How can I create a Windows application that can run with a GUI *or* as a Windows service in C#? c#Windows Service使用单个Mutex控制多个线程 - c# Windows Service controlling multiple threads with a single Mutex C#-从多个文件解析年/月,运行程序并在子文件夹(年/月)中创建新文件 - C# - Parse Year/Month from multiple files, run program and create new file in subfolders (year/month) 是否可以在 heroku 平台上运行 Windows 服务/应用程序(c#)? - is it possible to run windows service / app (c#) on heroku platform? 如何将新服务帐户引入现有C#Windows服务 - How to introduce a new service account to an existing C# windows service 在单个If语句中检查多个条件-C# - Checking multiple conditions in a single If statement - C#
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM