如何保存ListBox中数据 在指定路径下

qaqaqaaaaaa qaqaqaaaaaa 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
C# 如何将ListBox中的数据保存进我TextBox控件指定的路径中? 如下图

如下 是我写的Button获取文件路径 显示在TextBox中 我该如何去保存呢
private void btn_Save_Click(object sender, EventArgs e)
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.Description = "请选择文件路径";

if (dialog.ShowDialog() == DialogResult.OK)
{
string foldPath = dialog.SelectedPath;
DirectoryInfo theFolder = new DirectoryInfo(foldPath);

//theFolder 包含文件路径
tbx_Save.Text = dialog.SelectedPath;
FileInfo[] dirInfo = theFolder.GetFiles();
//遍历文件夹
foreach (FileInfo file in dirInfo)
{
MessageBox.Show(file.ToString());
}
}
}
...全文
评论 7
收藏 已收藏
分享
返回顶部
qaqaqaaaaaa
C# 111,129 成员 642,540 内容