我在程序里用
string SystemPath = Environment.SystemDirectory;//系统system文件夹
SystemPath = SystemPath.Substring(0,SystemPath.Length-SystemPath.LastIndexOf("\\"));
得到系统路径,为什么在win2003和win2000不一样,在win2000里最后有一个"\",win2003就没有。
不知道你们在编程中还发现了什么区别没有?

解决方案 »

  1.   

    你再用string.trim()方法来处理一下好了.
      

  2.   

    具体没有试过,
    可以参考MSDN的方法用 @ 引起来的优点在于换码序列“不”被处理,这样就可以轻松写出字符串,例如一个完全限定的文件名:
    @"c:\Docs\Source\a.txt"  // rather than "c:\\Docs\\Source\\a.txt"
      

  3.   

    win2003的windows目录是不是不给操作?
      

  4.   

    对于路径字符串,建议不要原始分析,
    使用Path类来操作,避免不必要的麻烦。
      

  5.   

    System.IO.Directory.CreateDirectory(System.Environment.SystemDirectory).Parent.FullName