How can i get from a FileInfo[] the file full name full directory including the file extension?

后端 未结 1 1106
不知归路
不知归路 2021-01-24 15:45

This is the code:

FileInfo[] flist = d.GetFiles();
if (flist.GetLength(0) > 0)
{
    foreach (FileInfo txf in flist)
    {
        string fn = txf.FullName +          


        
1条回答
  •  我在风中等你
    2021-01-24 16:37

    According to the documentation, FullName field of a FileInfo object includes full path, file name and file extension (FileInfo inherits FullName from FileSystemInfo). So it is more like the code, which is in charge for creating these files, is not appending the proper extension (Assuming d is a DirectoryInfo and not other - maybe homemade - class).

    0 讨论(0)
提交回复
热议问题