Solved

directory.getfiles result

Posted on 2011-03-11
1
633 Views
Last Modified: 2013-12-17
I want to find files that match my mask such as 96220*.pdf.  We store revision information after the part number and I need to snag whatever is available in the release folder that matches my root part number.

I am able to build the path where the files are located.  I am stuck on how to display the name of the file that is found.

How do I return a string that I can use to build by hyperlink?


        string filestub;
        filestub =  leftchars + @"000 - " + leftchars + "999";

        string dirstub;
        string dir2use;
        string files2find;
        string filemask;

        dirstub = @"d:\release\" + filestub + @"\";
        files2find = dirstub + s2parse + @"*.pdf";
        filemask = s2parse + @"*.pdf";
        Label1.Text = "Dirstub: = " + dirstub;  // this works
        Label2.Text = "filemask = "+ filemask;  // this works

        string[] myfiles = Directory.GetFiles(dirstub, filemask);

        if (myfiles != null)
            Label3.Text = myfiles.ToString();  //help!  displays "system.string[]"

0
Comment
Question by:crdn_dan
1 Comment
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
Comment Utility
Foreach (string file in myfiles)
  Label3.Text += file;
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

8 Experts available now in Live!

Get 1:1 Help Now