Solved

Message box question in C#

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now