TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dc
NA
663
0
C# select file by name
Feb 20 2013 11:27 AM
In a C# 2008 windows application, I want to select all reports that end with
ErrorReport.xlsx.
Here is the code I have so far:
string[] excelFiles = Directory.GetFiles(strFullpath, "*ErrorReport.xlsx")
.Select(path => Path.GetFileName(path))
.ToArray();
Can you tell me if this code will pick up the excel spreadsheets that end of ErrorReport.xlsx?
This would mean that I do not care about the length of the preceding part of the name. The name could look like the following:
cust1__H98__city_state_ErrorReport.xlsx.
Would this type a name be picked up with the code I have? If not, can you show me code that will pick all the files I am looking for? This could included file names that have special characters in them.
Reply
Answers (
1
)
BackColor Property
Must Declare Scalar variable "@photo"