单击该按钮,我需要下载/打开存储在WPF c#中本地计算机文件夹中的PDF文件。可以请给我一个代码吗?提前致谢。
试试这个我觉得这就是你需要的东西c#
File.Copy("Path to Local File","Path where you want to download file");
EG
File.Copy("C://test.txt","D://test.txt");
如果你只是想打开一个文件
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.InitialDirectory = @"C:\";
openFileDialog1.Title = "Browse Files";
openFileDialog1.CheckFileExists = true;
openFileDialog1.CheckPathExists = true;
openFileDialog1.RestoreDirectory = true;
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
//Do you operation here
}