Click here to Skip to main content
15,893,381 members
Home / Discussions / C#
   

C#

 
AnswerRe: Checking if string path is valid Pin
AspDotNetDev6-Mar-10 2:56
protectorAspDotNetDev6-Mar-10 2:56 
GeneralRe: Checking if string path is valid Pin
Saksida Bojan6-Mar-10 3:17
Saksida Bojan6-Mar-10 3:17 
AnswerRe: Checking if string path is valid Pin
PIEBALDconsult6-Mar-10 3:17
mvePIEBALDconsult6-Mar-10 3:17 
GeneralRe: Checking if string path is valid Pin
Saksida Bojan6-Mar-10 3:31
Saksida Bojan6-Mar-10 3:31 
GeneralRe: Checking if string path is valid Pin
PIEBALDconsult6-Mar-10 16:15
mvePIEBALDconsult6-Mar-10 16:15 
AnswerRe: Checking if string path is valid Pin
Eddy Vluggen6-Mar-10 3:21
professionalEddy Vluggen6-Mar-10 3:21 
GeneralRe: Checking if string path is valid Pin
Saksida Bojan6-Mar-10 3:36
Saksida Bojan6-Mar-10 3:36 
AnswerRe: Checking if string path is valid Pin
Luc Pattyn6-Mar-10 4:30
sitebuilderLuc Pattyn6-Mar-10 4:30 
In order to determine validity of a path, you should not modify the file system, hence CreateDirectory and RemoveDirectory are not acceptable. Calling them may cause a lot of unwanted side effects, e.g. when a FileSystemWatcher has been installed.

What you can do is:
1. use Path.GetFullPath()
2. use new DirectoryInfo()

each of those will throw an appropriate exception when the path isn't valid.

And of course you could parse the path yourself (not recommended).

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that.

GeneralRe: Checking if string path is valid Pin
Saksida Bojan6-Mar-10 10:58
Saksida Bojan6-Mar-10 10:58 
AnswerRe: Checking if string path is valid Pin
RichardM16-Mar-10 7:54
RichardM16-Mar-10 7:54 
AnswerRe: Checking if string path is valid Pin
Giorgi Dalakishvili6-Mar-10 10:09
mentorGiorgi Dalakishvili6-Mar-10 10:09 
QuestionDefault Code view. Pin
Saksida Bojan5-Mar-10 23:11
Saksida Bojan5-Mar-10 23:11 
AnswerRe: Default Code view. Pin
1.21 Gigawatts5-Mar-10 23:29
1.21 Gigawatts5-Mar-10 23:29 
GeneralRe: Default Code view. Pin
Saksida Bojan5-Mar-10 23:48
Saksida Bojan5-Mar-10 23:48 
GeneralRe: Default Code view. Pin
1.21 Gigawatts5-Mar-10 23:52
1.21 Gigawatts5-Mar-10 23:52 
GeneralRe: Default Code view. Pin
Luc Pattyn6-Mar-10 4:32
sitebuilderLuc Pattyn6-Mar-10 4:32 
GeneralRe: Default Code view. Pin
1.21 Gigawatts6-Mar-10 6:15
1.21 Gigawatts6-Mar-10 6:15 
QuestionZip Folders and Files Pin
Anil Kumar.Arvapalli5-Mar-10 21:38
Anil Kumar.Arvapalli5-Mar-10 21:38 
AnswerRe: Zip Folders and Files Pin
OriginalGriff5-Mar-10 21:40
mveOriginalGriff5-Mar-10 21:40 
AnswerRe: Zip Folders and Files [modified] Pin
1.21 Gigawatts5-Mar-10 21:40
1.21 Gigawatts5-Mar-10 21:40 
GeneralRe: Zip Folders and Files Pin
harold aptroot5-Mar-10 21:53
harold aptroot5-Mar-10 21:53 
GeneralRe: Zip Folders and Files Pin
1.21 Gigawatts5-Mar-10 21:54
1.21 Gigawatts5-Mar-10 21:54 
AnswerRe: Zip Folders and Files Pin
StarBP6-Mar-10 11:20
StarBP6-Mar-10 11:20 
QuestionExport Registry Pin
Anil Kumar.Arvapalli5-Mar-10 21:36
Anil Kumar.Arvapalli5-Mar-10 21:36 
AnswerRe: Export Registry Pin
Saksida Bojan5-Mar-10 21:40
Saksida Bojan5-Mar-10 21:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.