C#认识对话框
2021-03-13 12:28
标签:des 每日 path filename excel表格 数据 sel 对话 png 2020-03-22 每日一例第12天 1.新建对话框,拖Textbox/label/button;
2.“选择文件”按钮后的代码; OpenFileDialog op1 = new OpenFileDialog(); } 3.“选择文件夹”按钮后的代码; FolderBrowserDialog fd2 = new FolderBrowserDialog(); fd2.RootFolder = Environment.SpecialFolder.Desktop;
C#认识对话框 标签:des 每日 path filename excel表格 数据 sel 对话 png 原文地址:https://www.cnblogs.com/ljs7490/p/12543566.html
op1.Title = "选择数据文件";
op1.Filter = "所有文件|*.*|Excel表格|*.xls;*.xlsx";
op1.Multiselect = true;
if (op1.ShowDialog()==System.Windows.Forms.DialogResult.OK)
{
text1.Text = op1.FileName;
fd2.Description = "请选择一个文件夹";
fd2.ShowNewFolderButton = false;
if (fd2.ShowDialog()==System.Windows.Forms.DialogResult.OK)
{
text2.Text = fd2.SelectedPath;
}
下一篇:三、几种视图实现源码剖析:django原生View、rest_framework.views.APIView、rest_framework.generics.GenericAPIView、ViewSe