Check whether a path is valid

前端 未结 12 1896
小蘑菇
小蘑菇 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:12

    Get the invalid chars from System.IO.Path.GetInvalidPathChars(); and check if your string (Directory path) contains those or not.

提交回复
热议问题