怎么解决啊,谢谢各位了!

解决方案 »

  1.   

    ??
    string str = @"D:\skjdf\sdljf.txt";string path = str.SubString(0,str.LastIndexOf(@"\"));
    是这样吗?
      

  2.   

    MessageBox.Show(System.IO.Path.GetPathRoot(@"c:\aa\bb\cc.txt"));
      

  3.   

    Path .GetDirectoryName(fullFileName)
    -----------------------------------
    fullFileName :文件的全名
      

  4.   


    string kk=Path .GetDirectoryName(fullFileName).Tostring();
    server.Mapath(kk);