// Browses file with OpenFileDialog control
private void btnFileOpen_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialogCSV = new OpenFileDialog();
openFileDialogCSV.InitialDirectory = Application.ExecutablePath.ToString();
openFileDialogCSV.Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*";
openFileDialogCSV.FilterIndex = 1;
openFileDialogCSV.RestoreDirectory = true;
if (openFileDialogCSV.ShowDialog() == DialogResult.OK)
{
this.txtFileToImport.Text = openFileDialogCSV.FileName.ToString();
}
}
在上面的代碼中,我瀏覽了一個要打開的文件。我想要做的是,瀏覽文件,選擇它,然後按確定。點擊確定後,我想製作一個選擇文件的副本,併爲該副本文件添加一個.txt擴展名。我需要幫助來實現這一點。如何在OpenFileDialog控件中選擇文件的副本副本
感謝
這個作品,謝謝 – StackTrace