Click here to Skip to main content
15,919,500 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hey!

I have a question that maybe has been answered but here goes.

What I am trying to accomplish is getting a list of full file path(s) from a folder that should contain a single file.

The file name is constant except it is appended with a date. So basically the file name varies but always the same extension (example ".csv").

What I am going to do is use this file list to attach the file or files to a email.
I have built this up to the point that the program looks for a folder created named "todays date". Works great. If the folder is created a email is sent.

So I'd like to email the file(s) in that folder as an attachment to the email sent.

I'm still really new at this, so the simpler the answer the better!

Thanks in advance!
Nick
Posted

1 solution

Use Directory.EnumerateFiles[^] to retrieve a list of the files in a directory.

Use Directory.EnumerateDirectories[^] to retrieve a list of the directories within a directory.
 
Share this answer
 
Comments
Member 10654601 30-Mar-14 10:51am    
Thanks Mike!

I'll see if I can make this work!

Nick

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900