OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.Filter = "Microsoft Excel files(*.xls)|*.xls;*.xlsx";//过滤一下,只要表格格式的 openFileDialo... ...
一. 浏览图片 OpenFileDialog ofd = new OpenFileDialog(); ofd.InitialDirectory = @"E:\"; ofd.Filter = "Image Files(*.BMP;*.JPG;*.GIF)|*.BMP;*.JPG;*.GIF|All f ...
分类:
数据库 时间:
2017-08-11 21:14:08
阅读次数:
169
OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "请选择要打开的文本文件"; ofd.InitialDirectory = @"C:\Users\SpringRain\Desktop"; ofd.Multiselect = true; o ...
1.窗体下的代码 private void button1_Click(object sender, EventArgs e) { OpenFileDialog of = new OpenFileDialog(); of.Filter = "*.sql|*.*"; of.InitialDirecto ...
分类:
数据库 时间:
2017-06-24 13:54:39
阅读次数:
251
using System.IO; private void button1_Click(object sender, EventArgs e) { string strFilePath = ""; OpenFileDialog fd = new OpenFileDialog(); fd.Filter ...
private void btnOpenFile_Click(object sender, EventArgs e) { //OpenFileDialog 打开要使用的资源 using (OpenFileDialog ofd=new OpenFileDialog()) { ... ...
Excel文件导出的操作我们经经常使用到,可是讲一个Excel文档导入并显示到界面还是第一次用到。 以下简介下在C#下怎样进行Excel文件的导入操作。 首先加入两个引用 using System.IO; using System.Data.OleDb; 加入控件openFileDialog 然后我 ...
1 OpenFileDialog ofd = new OpenFileDialog(); 2 ofd.Filter = "(*.mp4)|*.mp4|(*.*)|*.*"; 3 ofd.RestoreDirectory = true; 4 if (ofd.ShowDialog() == Dialog... ...
分类:
编程语言 时间:
2017-06-01 15:15:21
阅读次数:
317
一、打开文件 Stream myStream = null; OpenFileDialog openFileDialog1 = new OpenFileDialog(); openFileDialog1.InitialDirectory = "d:\\"; openFileDialog1.Filte ...
对话框控件:ColorDialog - 颜色选择ShowDialog()DialogResult 类型对象.Color FontDialog - 字体选择ShowDialog()DialogResult对象.Font对象.Color OpenFileDialog - 文件打开对话框 ShowDial ...