实现效果:
知识运用:
File类的move方法 判断是否可以移动
实现代码:
private void button1_Click(object sender, EventArgs e) { radioButton2.Checked = true; openFileDialog1.ShowDialog(); try { File.Move(openFileDialog1.FileName,"C:\\C.EXE"); } catch (Exception ex) { radioButton1.Checked = true; } }