Solved

directory.getfiles result

Posted on 2011-03-11
1
674 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

808 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