E:\temp\FCKeditor_2.6.1.zip一个文件路径
我想得到FCKeditor_2.6.1.zip
有什么方便的方法

解决方案 »

  1.   

    System.IO.FileInfo  f = new System.IO.FileInfo(@"E:\temp\FCKeditor_2.6.1.zip");
    f.Name 
      

  2.   

    file.FileName.Substring(file.FileName.LastIndexOf("\\"))
    我是这样的方法
    不知会不会太笨
      

  3.   

     Path.GetFileName(@"E:\temp\FCKeditor_2.6.1.zip");
      

  4.   

            string str = "E:\\temp\\FCKeditor_2.6.1.zip ";
            int kk = str.LastIndexOf('\\');
            string finStr = str.Substring(kk + 1);
            Response.Write(finStr);
      

  5.   


    string strPath = @"E:\temp\FCKeditor_2.6.1.zip";
    strPath.Substring(strPath.LastIndexOf(@"\")+1,strPath.Length-(strPath.LastIndexOf(@"\")+1));我很笨的...
      

  6.   

    string strPath = @"E:\temp\FCKeditor_2.6.1.zip";
    strPath.Substring(strPath.LastIndexOf(@"\")+1);
      

  7.   

    笨办法:
    string a = "E:\temp\FCKeditor_2.6.1.zip";string[] b = a.Split('\')string c = b[2];c就是你要取的值
      

  8.   

    string strPath = "E:\temp\FCKeditor_2.6.1.zip";
    strPath.Substring(strPath.LastIndexOf("\\")+1,strPath.Length-(strPath.LastIndexOf(@"\")+1));就这么截取~~