如何填充组合框上的C#与来自迪尔的namefiles? [英] How to fill a Combo Box on C# with the namefiles from a Dir?

查看:130
本文介绍了如何填充组合框上的C#与来自迪尔的namefiles?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望你能帮助我解决这个问题。

I hope you can help me with this problem.

我一直在试图填补特定目录的namefiles的组合框。这DIR将永远一样的,所以这将是永远不变的程序。

I've been trying to fill a combobox with the namefiles of a specific directory. This DIR will be always the same so it will be the same routine always.

任何想法?

干杯!

推荐答案

在初始化做到这一点:

    private void Form1_Load(object sender, EventArgs e)
    {
        string[] files = System.IO.Directory.GetFiles(@"C:\Testing");

        this.comboBox1.Items.AddRange(files);
    }

这篇关于如何填充组合框上的C#与来自迪尔的namefiles?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆