Possible Duplicate:
Path.Combine for Urls?
I have a root directory like http://localhost/
I have a file name call sample.jpg
when I use Path.Combine(root, file), I get something like http://localhost\sample.jpg, I am wondering if I can get http://localhost/sample.jpg.
Path.Combineis designed for file system paths, not URLs, so I don’t think it will give you what you desire in this case. You can always do thePath.Combine, followed by aString.Replace("\", "/")to correct your URL.