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# locate files with various extensions
Oct 14 2012 11:00 AM
In a C# 2008 application, I have the code listed below to select pdf files from a specific location.
string partPath = "C:\\temp";
string strFullpath = partPath + "\\Docs\\";
string[] Files = Directory.GetFiles(strFullpath, "*pdf")
.Select(path => Path.GetFileName(path))
.ToArray();
I need to be able to look for other document types like *.docx, *.xlsx, and *.xls.
Thus can you tell me how to modify the code listed above and/or write new code where I
can pick records where the last node is either *.pdf, *.xls, *xlsx, or *.docx.
Reply
Answers (
2
)
Here how to convert string to double ..
C# add to array