You could do string operation to construct path as below :
string path = path1 + "\\" + path2;
However, more portable and cleaner way would be to use Path.Combine as below :
Path.Combine(path1, path2);
The above avoid you to make manually ensuring the correctness of path separators.
Monday, April 14, 2014
Better way of combining path in C#
Diposting oleh Hafiz di Monday, April 14, 2014
Label: csharp
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment