[英]How to auto pick up files from ftp server folder and save the filename content in SQL database table using C# code
I'm new in my development role, I have to automatically pick up multiple files in specific format once per week from the FTP folder. 我是开发人员的新手,我必须每周一次从FTP文件夹自动提取特定格式的多个文件。
The file names are in this format: 文件名采用以下格式:
PODLM_10011548501_PTY002323_8569865954.tiff
PODLM_10011548502_PTY002324_8569865955.tiff
After picking them up, I need to save the filename info into an existing SQL table called order
as follows: 拾取它们后,我需要将文件名信息保存到一个名为
order
的现有SQL表中,如下所示:
Order
table: Order
表:
id CodeNumber PPNumber ClientID
1 10011548501 PTY002323 8569865954
2 10011548502 PTY002324 8569865955
Any advice or solution will be appreciated 任何建议或解决方案将不胜感激
Thanks 谢谢
I suggest you to split this question into 4 small questions: 我建议您将这个问题分为四个小问题:
Read files from ftp? 从ftp读取文件?
Create a weekly task? 创建每周任务?
Split a string and save it in a model? 分割字符串并将其保存在模型中?
Save a model in sql data base? 在sql数据库中保存模型?
Google these questions and you will be in your way to accomplish the mission, Google这些问题,您将一路完成任务,
Good luck. 祝好运。
What we've done in the past is to create small app, can be a console app that reads the folder in question. 我们过去所做的是创建小型应用程序,它可以是读取有问题的文件夹的控制台应用程序。 Makes no difference if it is an ftp folder or what the file type is.
如果它是ftp文件夹或文件类型是什么都没有关系。 You determine that.
您确定。 In that same app you can connect to you DB and then save any info you need.
在同一应用中,您可以连接到数据库,然后保存所需的任何信息。
Then using MS scheduler you can create a schedule to schedule your app to run once a week, or at any interval you choose 然后,使用MS Scheduler,您可以创建一个时间表来安排您的应用每周运行一次,也可以选择您选择的任何间隔运行
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.