Hi, I am using a relative file path in one of the cs file to get a location to save an image.
Is there any difference in using ../ and ..// for getting the path.
Hi, I am using a relative file path in one of the cs file to get a location to save an image.
Is there any difference in using ../ and ..// for getting the path.
There shouldn't be, though I don't know about with ASP.NET. Are you having trouble with it?
On Unix, and I think MS-DOS and hence Windows follows Unix closely enough here that it is not a difference between the systems, then you can have any number of consecutive slashes at any point in a pathname and it is equivalent to a single slash. Consequently, your two examples are equivalent.
Note that on Windows, a double slash at the start of a path name indicates a UNC path - a machine name followed by a path on that machine.
I don't know if your slashes are actually backslashes, but in c#, you have to escape backslashes.
var path = "..\\file.txt";
path's value is actually ..\file.txt, because the "\" is actually one (escaped) backslash.
However, if it is:
var path = @"..\file.txt";
then it is the same. The @ means you want the string as-is, without any escaping, so both "path" variables are the same.