有一个文件在D:\新建 Microsoft Excel 工作表.xlsx  我想讲这个路劲出来 该怎么做  
 

解决方案 »

  1.   

          string newfilepath = Application.StartupPath + filename;
      这样子他读取的是本程序问价下面是否有这个文件
      

  2.   

    该去补习语文...ps:去看看MSDN中System.IO命名空间...
      

  3.   

    看不懂楼主想说啥,既然已经知道文件路径,那么
    例如这样string fileName = @"C:\mydir\myfile.ext";
    string path = @"C:\mydir\";
    string rootPath = @"C:\";什么路径都都有了
      

  4.   

    你是不是问获取路径的控件啊?OpenFileDialog
      

  5.   

    找到这个文件?File 类
    还是去路径?楼上
      

  6.   

    string path=fleUpload.PostedFile.FileName
      

  7.   

    string path = System.IO.Path.GetDirectoryName(@"D:\新建 Microsoft Excel 工作表.xlsx");返回值:path = "d:\"