(WPF) 文件和文件夹选择对话框。


点击button,选择一个excel文件,并将文件名显示在textbox上。

        private void btnSelectErrorTableFile_Click(object sender, RoutedEventArgs e)
        {
            var openFileDialog = new Microsoft.Win32.OpenFileDialog() 
            { 
                Filter = "Excel Files (*.xlsx)|*.xlsx" 
            };
            var result = openFileDialog.ShowDialog();
            if (result == true)
            {
                this.tbErrorCodeTableFile.Text = openFileDialog.FileName;
            }
        }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM