Link to home
Start Free TrialLog in
Avatar of JDL129
JDL129

asked on

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
Avatar of enkor
enkor
Flag of Czechia image

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

Avatar of Dirk Haest
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);

ASKER CERTIFIED SOLUTION
Avatar of Dirk Haest
Dirk Haest
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JDL129
JDL129

ASKER

Thanks for the response!!!

Just what I wanted!!

Jerry