如何保存ListBox中数据 在指定路径下
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());
}
}
}

如下 是我写的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());
}
}
}
...全文


