C#遍历文件夹,直到找到正确的文件 [英] C# to loop through folder until it finds the correct files

查看:420
本文介绍了C#遍历文件夹,直到找到正确的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行一个批处理做一个更新到我的SQL表。我使用Windows调度运行该批处理文件。每一天的文件来在不同的时间。有时他们在我的预定时间后,因此当有文件夹中的计划任务之前,没有文件的批处理文件不运行。我想创建地方将通过文件夹循环,直到它找到文件的C#程序,然后移动到批处理文件中的下一个步骤。基本上我的目标是创建一个程序,将寻找那些特定的文件,一旦他们找到正确的文件,那么它就会开始更新。我是新来编程,需要一些方向。是否有人可以帮助我?谢谢你。

I’m running a batch to do an update to my sql table. I’m using windows scheduler to run the batch file. Each day files come in at different time. Sometime they come in after my scheduled time therefore the batch file doesn’t run when there’s no file before the scheduled task in the folder. I want to create a c# program where it will loop through the folder until it finds the files and then move to the next step in the batch file. Basically my goal is to create a program that will look for those particular files and once they finds the correct files then it will start the update. I’m new to programming and need some direction. Can someone please help me with this? Thanks.

推荐答案

阅读 FileSystemWatcher的类的<​​a href =HTTP ://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx相对=nofollow>这里

环接将消耗CPU

这篇关于C#遍历文件夹,直到找到正确的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆