C# 获取文件名及扩展名
来源:互联网 发布:淘宝号信誉查询131458 编辑:程序博客网 时间:2024/09/21 09:22
http://blog.csdn.net/houxingding/article/details/17484339
FileStream fileStream = new FileStream(@txtPath.Text, FileMode.Open);
//txtPath.Text是文件路径
string fileName = fileStream.Name.Substring(
fileStream.Name.LastIndexOf("\\") + 1);
//获取包含扩展名的文件名
string aLastName = fileStream.Name.Substring(
fileStream.Name.LastIndexOf(".") + 1);
//获取扩展名
string Name=fileStream.Name.Substring(
fileStream.Name.LastIndexOf("\\") + 1
, fileStream.Name.LastIndexOf(".")
- fileStream.Name.LastIndexOf("\\") - 1);
//获取不包含扩展名的文件名
阅读全文
0 0
- C# 获取文件名及扩展名
- C# 获取文件名及扩展名
- C# 获取文件名及扩展名
- C# 获取文件名及扩展名
- C# 获取文件名及扩展名
- C# 获取文件名及扩展名
- C# 获取文件名及扩展名
- C# 获取文件名及扩展名
- C# 获取文件名及扩展名
- C# 获取文件名和扩展名
- C# 获取文件名和扩展名
- C# 获取文件名和扩展名
- 青蛙學堂 C# 获取文件名及扩展名
- 【CString】获取文件名及扩展名
- C#通过文件路径获取文件名、扩展名
- C# 获取文件名和扩展名(后缀名)
- 从链接中获取文件名及扩展名
- 获取input上传文件文件名及扩展名
- XListView加头布局ViewPager轮播
- hibernate 链接Mysql数据库小案例
- 中值定理
- MFC EditControl控件实现换行且滚动条自动跟随(实例)
- Android Studio 更换包名方法
- C# 获取文件名及扩展名
- Ningx快速入门
- SQL 合并列值和拆分列值
- 终于,腾讯也要造车了
- Unity 资源优化方法及移动设备上优化
- C/C++运行期堆栈【转】
- Elasticsearch——分页查询From&Size VS scroll
- ListView+优化
- ImageLoader的简单使用