1.添加下拉框控件命名为‘comboBoxModelPCB’
2.添加代码
RobotProfile RobotProfile1 = new RobotProfile();//实例化 DirectoryInfo folder = new DirectoryInfo(RobotProfile1.robotProfilePath);//new文件夹 foreach (DirectoryInfo dir in folder.GetDirectories())//加载文件夹中的型号 { comboBoxModelPCB.Items.Add(dir.Name); }
参数:
RobotProfile1.robotProfilePath :是文件保存地址;
在后续中更改文件地址:folder =new DirectoryInfo(RobotProfile1.electronicComponentPath);//加载元件目录