简体   繁体   中英

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.

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 table:

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?

Create a weekly task?

Split a string and save it in a model?

Save a model in sql data base?

Google these questions and you will be in your way to accomplish the mission,

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. 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

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