在意段代码上看到的,很不理解 
string ConfigFileUrl = "config/ipConfig.dat";
string ConfigFileUrl = "config//ipConfig.dat";
有什么区别吗~~~,具体表示的把什么赋值给字符串阿~~~?新手~~希望能帮忙解惑~~~

解决方案 »

  1.   

    string ConfigFileUrl = "config/ipConfig.dat"; 
      

  2.   

    不好意思我看错了~~~
    实际上是这样的~~~
    string ConfigFileUrl = "config\ipConfig.dat"; 
    string ConfigFileUrl = "config//ipConfig.dat"; 
    但是还是没弄明白~~~?
      

  3.   

    应该是string ConfigFileUrl = @"config\ipConfig.dat";  
    或者  string ConfigFileUrl = "config\\ipConfig.dat";  另一个变成注释了 string ConfigFileUrl = "config//ipConfig.dat"
      

  4.   

    对不起,弄错了。
    引号里的//不是注释,不过这样写URL肯定是不对的
      

  5.   

    看MSDN文档:
    public static readonly char DirectorySeparatorCharDirectorySeperateChar is a slash ("/") on UNIX, and a backslash ("\") on the Windows and Macintosh operating systems.反斜杠("\")在string中表示的时候需要在前面加一个转义字符"\",所以就成了"\\"
      

  6.   

    看MSDN文档:
    public static readonly char DirectorySeparatorCharDirectorySeperateChar is a slash ("/") on UNIX, and a backslash ("\") on the Windows and Macintosh operating systems.反斜杠("\")在string中表示的时候需要在前面加一个转义字符"\",所以就成了"\\"
      

  7.   

    看MSDN文档:
    public static readonly char DirectorySeparatorCharDirectorySeperateChar is a slash ("/") on UNIX, and a backslash ("\") on the Windows and Macintosh operating systems.反斜杠("\")在string中表示的时候需要在前面加一个转义字符"\",所以就成了"\\"
      

  8.   

    string ConfigFileUrl = "config\ipConfig.dat";  
    string ConfigFileUrl = "config//ipConfig.dat";  
    两个都没错
    都等于
    config路径下的ipConfig.dat
      

  9.   

    \\这个不是转义字符嘛.就VB.NET里的\
    两个变一个.
    \r\n在C#里是换行.VB.NET
    CHAR(13)是一样的.
      

  10.   

    文件路径的两种写法:
    string path = @"c:\test.txt";
    string path = "c:\\test.txt";