OpenFileDialog的基本操作
来源:互联网 发布:interlagos羽绒被 知乎 编辑:程序博客网 时间:2024/06/05 09:16
一.获取文件名和文件路径问题
System.IO.Path.GetFullPath(openFileDialog.FileName);
System.IO.Path.GetExtension(openFileDialog.FileName);
System.IO.Path.GetFileNameWithoutExtens
System.IO.Path.GetFileName(openFileDialog.FileName);
System.IO.Path.GetDirectoryName(openFileDialog.FileName);
二.如何弹出文件选择对话框
var openFileDialog = new Microsoft.Win32.OpenFileDialog()
{
//设置文件的后缀名
Filter = "文本文件(*.txt)|*.txt|Excel (*.xls 或 *.xlsx)|*.xls;*.xlsx|access (*.mdb 或 *.accdb)|*.mdb;*.accdb||"
};
var result = openFileDialog.ShowDialog();
if (result == true)
{
//todo 选择文件后的逻辑
//获取该文件的绝对路径
string strPath=importData.filePath = openFileDialog.FileName;
}
- OpenFileDialog的基本操作
- OpenFileDialog 基本用法
- unity3d各种OpenFileDialog操作
- unity3d各种OpenFileDialog操作
- unity3d各种OpenFileDialog操作
- unity3d各种OpenFileDialog操作
- unity3d各种OpenFileDialog操作
- unity3d各种OpenFileDialog操作
- unity3d各种OpenFileDialog操作
- unity3d各种OpenFileDialog操作
- C# 关于打开文件对话框的操作 OpenFileDialog
- 关于c#的OpenFileDialog
- 关于OpenFileDialog的问题
- wm6下的OpenFileDialog
- openFileDialog的使用
- OpenFileDialog的使用
- 关于 OpenFileDialog 的问题
- OpenFileDialog的使用
- 线程安全和可重入函数区别
- POJ 3069 Saruman's Army 【贪心】
- javascript3-循环结构
- Mysql 分页优化
- Android下拉刷新之ZrcListView
- OpenFileDialog的基本操作
- CALayer Animatable Properties
- 迷宫问题
- 安装JDK8u91之后打开Eclipse报错:
- 常用算法
- 双连通性
- matlab GUI
- Android MVP开发模式实例
- 中山题解