private void Border_MouseLeftButtonUp_4(object sender, MouseButtonEventArgs e) { //获取项目中文件 string WantedPath = System.Windows.Forms.Application.StartupPath.Substring(0, System.Windows.Forms.Application.StartupPath.LastIndexOf(@"\")); string path2 = System.IO.Path.GetDirectoryName(WantedPath); path2 = path2 + @"\Excel\任务分配管理Excel文件.xls"; //用户选择目录 System.Windows.Forms.FolderBrowserDialog fbd = new System.Windows.Forms.FolderBrowserDialog(); fbd.ShowDialog(); var s = fbd.SelectedPath; if (fbd.SelectedPath != string.Empty) { File.Copy(path2, fbd.SelectedPath + "\\任务分配管理Excel文件.xls", true); MessageBox.Show("下载完毕"); } }
原文地址:https://www.cnblogs.com/SeNaiTes/p/9504929.html
时间: 2024-10-12 22:11:23