Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
327 views
in Technique[技术] by (71.8m points)

listboxitem - ListBox, Trying To get files in a folder

I am trying to get the name of all files inside of a folder(Only Once Per File & only when this form loads (for now)) and put them inside of a list box, each file in the folder as their own "Item". I am running into a problem where when I try pointing to a specific folder to get all of the files it gives me an error.

Am I just Using the wrong method?

namespace Experiment
{
public partial class Form2 : Form
{
    public static String StockPath = "D:/Visual Studios/Projects CustomFileSystems/FolderOne/Files";

    public Form2()
    {
        InitializeComponent();
        Movie_Checkedlistbox.Items.Add(System.IO.Path.GetFileNameWithoutExtension(StockPath))
    }

    private void Movie_Checkedlistbox_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}

}


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...