backslash \ and slash/Transfer Character path in C #
in C #, \ is an escape character, as shown below
escape sequence character
\ 'single quotation marks
\ "double quotation marks
\ backslash
\ 0 null
\ a warning
\ B Return
\ f form feed
\ n line feed
\ r driving
\ t horizontal tab
\ v vertical tab
For example, if you want to output this string "/_ \", you may think it is as follows @""/_\""
But writing the compiler won't let you pass it, but as shown in the table above, you can write "\"/_ \ "" in this way "\"/_\\\""
In addition, many users prefer D: \ test.txt when obtaining the file path.
Then the so-called Escape Character error will occur.
The solution is to use @ D: \ test.txt. I don't know if this will cause some problems.
However, I have always done that D:/test.txt is completely accessible.
I found it online. It seems that the biggest difference between a slash and a backslash is
In the network, the command line parameters cannot be separated by a slash (/) in windows.
In a UNIX system,/indicates a directory. Because the Web Name follows the Unix name,/indicates the directory in the URL.
Backslash \, which is used to represent directories in windows.
But at least in directory access, no one has ever encountered a slash problem. Which one has encountered a similar problem and hopes to leave it on my blog? Thank you first.