Solved

Message box question in C#

Posted on 2011-03-18
4
303 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
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

713 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