// 如果url后面用反斜杠,就不会显示任何背景(4)出现在普通字符串中的路径,如果代表的是windows文件路径,则使用 斜杆/ 和 反斜杠\ 是一样的;如果代表的是网络文件路径,则必须使用 斜杆/ ; // 本地文件路径,/ 和 \ 是等效的 // 网络文件路径,一定要使用 斜杆/ 斜杆/ 和 反斜杠\ 的区别基本上就是这些了,下面再讨论一下相对路径和绝对路径。./SRC/ 这样写表示,当前目录中的SRC文件夹; ../SRC/ 这样写表示,当前目录的上一层目录中SRC文件夹;/SRC/ 这样写表示,项目根目录(可以只磁盘根目录,也可以指项目根目录,具体根据实际情况而定)
在网上搜了许久,才发现这篇来自Common Errors inEnglish Usage的在理解上能差强人意.
This is aslash: /. Because the top of it leansforward, it is sometimes called a “forward slash.”
This is abackslash: \. Notice the way it leansback, distinguishing it from the regular slash.
Slashes are often used to indicate directoriesand subdirectories in computer systems such as Unix and in WorldWide Web addresses. Unfortunately, many people, assuming“backslash” is some sort of technical term for the regular slash,use the term incorrectly, which risks confusing those who knowenough to distinguish between the two but not enough to realizethat Web addresses rarely contain backslashes.
正斜杠/slash表示除法,分隔。在windows系统中通常用来分隔命令行参数,/表示选项等。不能作为文件名。
而在unix系统中,/表示目录。由于web遵循unix命名,所以在网址(URL)中,/表示目录。
反斜杠\backslash,在windows系统中用来表示目录。