Tuesday, January 11, 2011

C# and path concatenation

Never ever use string methods or operations for path concatenation because you will have to handle many low level aspects such as amount of slashes. Also if you think about cross platform development you will have to detect yourself which path separator to use.

Just use
Path.Combine(path1, path2)

That's all folks