I need to check for whether the file folder is created in successfully in C#. How to?

Hi there;

I need to check for whether the file folder is created in successfully in C#.

I mean i need to have a function whether the file is created successfully, return true or return false.

Same for different function checking for folder creation.

Kind regards.
LVL 12
jazzIIIloveAsked:
Who is Participating?
 
plusone3055Commented:
http://bytes.com/topic/c-sharp/answers/249872-check-folder-directory-exist-not

bool exists = System.IO.Directory.Exists(@"c:\myPath");
0
 
jazzIIIloveAuthor Commented:
I want to check not the exist case.

I just want to create a directory and if the creation fails or not.

Kind regards.
0
 
plusone3055Commented:
after the  create process run the code i gave you checking if exist will prove whether it was created successfully or not :)
0
 
jazzIIIloveAuthor Commented:
Ehm. You are right.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.