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
yamid
NA
98
0
Get some files with an extension in a directory with C#
Apr 20 2014 3:53 PM
I have a directory with many files where many of them have the same name with different extension. I want a C# code to search the directory and to get only the files with extension ".jpg" if the same file name with extension ".pdf" DOES NOT exists.
Example: In my directory I have these files:
"A.jpg"
"A.pdf"
"A.png"
"B.jpg"
"B.png"
"C.jpg"
"C.pdf"
"C.docx"
"D.pdf"
"E.jpg"
"F.jpg"
"F.pdf"
"F.docx"
The code should search this directory and get all the .jpg files if its .pdf file doesn't exist. therefore the code should give this files:
{"B.jpg", "E.jpg"}.
Thank you
Reply
Answers (
1
)
how to make trial versjon with C#?
Pass value between different form user search field value f