Solved

directory.getfiles result

Posted on 2011-03-11
1
651 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
ID: 35108596
Foreach (string file in myfiles)
  Label3.Text += file;
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

867 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

19 Experts available now in Live!

Get 1:1 Help Now