Check whether a path is valid

前端 未结 12 1899
小蘑菇
小蘑菇 2020-11-27 03:39

I am just wondering: I am looking for a way to validate if a given path is valid. (Note: I do not want to check if a file is existing! I only want to proof the validity

12条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 04:10

    Just Simply Use

    if (System.IO.Directory.Exists(path))
    {
        ...
    }
    

提交回复
热议问题