[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

directory.getfiles result

Posted on 2011-03-11
1
Medium Priority
?
712 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
[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
1 Comment
 
LVL 53

Accepted Solution

by:
Dhaest earned 2000 total points
ID: 35108596
Foreach (string file in myfiles)
  Label3.Text += file;
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

649 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