om471987
om471987

Reputation: 5627

What are the different ways to use directories in Windows?

I am getting directories from users and storing in databases. I really need validation whether they are correct. Right now I have the list of directories which can be used in a valid manner.

Only drive name - (with and without trailing forward or backward slash)

X:                    

Drive with direcory - (with forward or backward slashes and with and without trailing forward or backward slash)

X:\Test  

Only two forward or backward slashes (without trailing forward or backward slash)

\\teela\admin$

IP address - (with and without trailing forward or backward slash)

\\192.168.1.13

IP address with direcory - (with forward or backward slashes and with and without trailing forward or backward slash)

\\192.168.1.13\test

Can you please tell me if this is the complete list or we can write the directories in another ways?

Upvotes: 1

Views: 135

Answers (1)

markyd13
markyd13

Reputation: 719

You can use the NDepend.Helpers.FileDirectoryPath library to handle this for you. It includes a path validity check API.

Upvotes: 2

Related Questions