0
我想從OpenFileDialog複製文件到文件路徑 而我仍然是一個基本的,所以這對我來說很難。我也谷歌的東西,但我不明白這麼多。 是否有人可以幫助我複製從OpenFileDialog選定的文件c#
private void button2_Click(object sender, EventArgs e)
{
// Show the dialog and get result.
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK) // Test result.
{
string newPath = @"C:\Users\" + un + "\\AppData\\Roaming\\NF";
File.SetAttributes(newPath, FileAttributes.Normal);
File.Copy(openFileDialog1.FileName, newPath, true);
}
}
你面臨什麼問題? –
它說目標是一個目錄而不是文件thingy:3。 –