111,126
社区成员
发帖
与我相关
我的任务
分享FolderBrowserDialog F = new FolderBrowserDialog();
string SourceFilePath = "aaa.xml";
if (F.ShowDialog() == DialogResult.OK)
{
string TargetFilePath = System.IO.Path.Combine(F.SelectedPath, "bbb.xml");
System.IO.File.Copy(SourceFilePath, TargetFilePath);
} string SourceFilePath = "aaa.xml";
string TargetFileName = "bbb.xml";
FolderBrowserDialog F = new FolderBrowserDialog();
F.Description = string.Format("请选择目标文件夹,目标文件名为{0}(不可更改)", TargetFileName);
if (F.ShowDialog() == DialogResult.OK)
{
string TargetFilePath = System.IO.Path.Combine(F.SelectedPath, TargetFileName);
System.IO.File.Copy(SourceFilePath, TargetFilePath);
}