Thursday 6 December 2007

Combine file path with out worring about '\' problems

System.IO.Path.Combine does the '\' checking for us, we don't need to worry about \\ problems which occur sometimes.
when building a path string use System.IO.Path.Combine

example:
System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "filename.gif")
will output: fullpath\filename.gif

No comments: