你可以用GetDictionaryPath(..)这个函数,来获得所处文件的路径

解决方案 »

  1.   

    System.IO.Path.GetFileName("C:\data\myData.mdb");
      

  2.   

    string FileFullName=OpenFileDialogPicture.FileName;//FileFullName包含路径和文件名
    FileInfo TheFile1=new FileInfo(FileFullName);//通过获取TheFile1.Name来得到不包含路径只包含文件名的信息
    string PictureName=TheFile1.Name;//将文件名赋予PictureName
    MessageBox.Show(PictureName);//可以写上这句验证一下
      

  3.   

    实际就是处理字符串阿string str=@"C:\data\myData.mdb";
    int weizhi=str.lastindex(str,@"\");
    string result=str.right(str,weizhi);result就是你要的文件名阿