Solved

directory.getfiles result

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

724 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