Good reasons to pass paths as strings instead of using DirectoryInfo/FileInfo

Posted by neodymium on Stack Overflow See other posts from Stack Overflow or by neodymium
Published on 2009-03-20T18:10:59Z Indexed on 2010/04/17 3:23 UTC
Read the original article Hit count: 252

Filed under:
|
|

In my new code I am not using strings to pass directory paths or file names. Instead I am using DirectoryInfo and FileInfo as they seem to encapsulate a lot of information.

I have seen a lot of code that uses strings to pass directory information then they "split" and "mid" and "instr" in long incomprehensible statements until they get the part of the directory they are looking for.

Is there any good reason to pass paths as strings?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about directory