在字符串前加 @即可例:  string str=@"C:\windows\system32\abc.txt"

解决方案 »

  1.   

    也许我还没说清楚..
    这么说吧, 我想定义一个字符串的值为 " 
    string xx= " " ";  这样肯定是不行的,  string xx="@"";  也不行啊.
      

  2.   

    "号 string xx="\"" 
    \号 string xx="\\"
      

  3.   

    string xx =" \" ";
      

  4.   

    转义符号\
    string str=@"C:\windows\system32\abc.txt"

    string str="C:\\windows\\system32\\abc.txt"
      

  5.   

    \:这个是转义符号。即如果是 \\ 指的就是一个  \
    @:如果str=@"C:\windows\system32\abc.txt"指的就是    C:\windows\system32\abc.txt   这个字符串