Windows is the bastard child of operating systems in this regard, but a lot of APIs will accept forward slashes as well. On Windows, a file path looks like this:
C:UsersjsmithDocumentsfile.txt
On a Unix-like system (including Mac OS X and Linux), the same path would look like this:
/home/jsmith/Documents/file.txt
A URL, standardized in RFC 1738, always uses forward slashes, regardless of platform:
http://home.example.com/Documents/file.txt
The reason for this is historical. Not even Windows can reverse our thinking on URLs. When you're talking about backslashes, the only platform you'll find that uses them is Windows (and some other novelty ones).
Where you might see backslashes used other than Windows would be UNC paths -- however, Windows is the chief proponent of these as well:
\HOMESVRDocumentsfile.txt
And whatever you do, don't make a commercial for your Web site and say "my company dot com back slash promotion".
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…