Message box question in C#

I need to know how to display the information from this code:

            string[] strFileName = Directory.GetFiles(InitVar.filePath + "/FTP/", "POS*.TXT");

in a Message box.

Thanks guys,

Jerry
JDL129Asked:
Who is Participating?
 
DhaestCommented:
In one string:

Messagebox.Show(string.Join(",",strFileName );
0
 
enkorCommented:
try this:
string[] strFileName = Directory.GetFiles(InitVar.filePath + "/FTP/", "POS*.TXT");
string s = "";
foreach (string ss in strFileName)
{
   s += ss + "\r\n";
}

MessageBox.Show(s);

Open in new window

0
 
DhaestCommented:
Do you want to display all the filenames in one box or one by one ?

One by one:

foreach(string fileName in strFileName )
            Messagebox.Show(fileName);

0
 
JDL129Author Commented:
Thanks for the response!!!

Just what I wanted!!

Jerry
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.