how can I make sure whether the directory is exit or not

Advertisement

xxkwanglei
Joined:
Posts:
2
Location:
zhejiang.china

how can I make sure whether the directory is exit or not

in .NET C#
before using seesion.CreatDirectory("PATH") to create directory,I want to make sure whether the directory is exit or not?
how can I do?

Reply with quote

Advertisement

xxkwanglei

Re: how can I make sure whether the directory is exit or not

thanks
the example shows whether a file in the directory or not, my question is how can I make sure whether the directory is exit or not,if the directory is not exit ,I have to create it before put files in the directory.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: how can I make sure whether the directory is exit or not

xxkwanglei wrote:

thanks
the example shows whether a file in the directory or not, my question is how can I make sure whether the directory is exit or not,if the directory is not exit ,I have to create it before put files in the directory.
I'm not sure if understand your problem. Anyway, note the the method works for directories too.

Reply with quote

Advertisement

You can post new topics in this forum