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 of the path - So if a file could possibly exists at the location).
Problem is, I can't find anything in the .Net API.
Due to the many formats and locations that Windows supports, I'd rather use something MS-native.
Since the function should be able to check against:
- Relative Paths (./)
- Absolute Paths (c:mp)
- UNC-Pathes (some-pcc$)
- NTFS-Limitations like the full path 1024 chars - If I am not mistaken exceeding the path will make a file inaccessible for many
internal Windows functions. Renaming it with Explorer still works
- Volume GUID Paths : "?Volume{GUID}somefile.foo
Does anyone have a function like this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…