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# string selection
Oct 7 2012 9:53 PM
In a C# 2008 console application, I want to select files from a specific folder location and then select certain excel spreadsheets from that location. I want to pick files where the first part of the name can be anything but the last part of the name is summ.xlsx.
I know I can pick the directory path with a statement that looks like the followinng:
If (Directory.Exists(strFullpath)).
I know that if I want to ask if a file exists by the full name, I would say:
if (File.Exists("CompanyName_summ.xlsx").
However in this case I want to pick files where the last part of the name ends with
summ.xlsx. Note: Due to the fact there are several kinds of *.xlsx files that will reside in the specific directory, I can not pick the files by the *.xlsx file extension alone.
Thus can you tell me how I would write the code to ask if "_summ.xlsx" exist in the selected directory? Also if the files exist, I would also like code and/or be pointed to a reference that will show me how to access the excel spreadhseet(s).
Reply
Answers (
4
)
C# linq use 3 tables
what is meant by pre-define error that may occur in vb application