Solved

Message box question in C#

Posted on 2011-03-18
4
311 Views
Last Modified: 2012-05-11
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
0
Comment
Question by:JDL129
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:enkor
ID: 35164727
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
 
LVL 53

Expert Comment

by:Dhaest
ID: 35164735
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
 
LVL 53

Accepted Solution

by:
Dhaest earned 50 total points
ID: 35164745
In one string:

Messagebox.Show(string.Join(",",strFileName );
0
 

Author Closing Comment

by:JDL129
ID: 35168692
Thanks for the response!!!

Just what I wanted!!

Jerry
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question