Based on what you have posted, dfilename/filename is a MultiDimensional Array / Object and
.ToString()
will print out the name of the Object. The easiest way is to use
Linq
to select all the file names and then use the
string.join
method to display all the items in comma separator.
using System;
using System.Linq;
public class Program
{
public static void Main()
{
var filenames = new string[2, 2];
filenames[0, 0] = "abcd00";
filenames[0, 1] = "abcd01";
filenames[1, 0] = "abcd10";
filenames[1, 1] = "abcd11";
string[,] dfilename = filenames;
var fName = from string filename in dfilename
select filename;
Console.WriteLine("dfilename: " + string.Join(",", fName));
}
}
Output:
dfilename: abcd00,abcd01,abcd10,abcd11