2013-09-28 241 views

回答

1
private void button1_Click(object sender, EventArgs e) 
     { 
      var openFileDialog=new OpenFileDialog {Filter = @"Zip Files|*.zip|RAR Files|*.rar|All Files|*.*"}; 

      if (DialogResult.OK == openFileDialog.ShowDialog()) 
      { 
       File.Copy(openFileDialog.FileName, Application.StartupPath + @"\" 
        + Path.GetFileName(openFileDialog.FileName)); 

       yourvariable = Application.StartupPath + @"\" 
           + Path.GetFileName(openFileDialog.FileName); 
      } 
     } 

您的文件將被複制到爲yourprojectname \爲yourprojectname \ BIN \調試

+0

非常感謝你這奏效了! – GreatGatsby

+1

我很高興幫助 – Alyafey

相關問題