在不同情况下使用文件扩展名加载文件 [英] file loading with file extensions in different cases

查看:62
本文介绍了在不同情况下使用文件扩展名加载文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在编写用于加载图像的代码.

这是代码行.

Hi,
I am writing a code for loading images.

This is the line from the code.

CFileDialog fOpenDlg(TRUE, "txt", "", OFN_FILEMUSTEXIST|OFN_EXPLORER|OFN_HIDEREADONLY ,"All Image Files (*.jpg;*.jpeg;*.bmp;*.png)|*.jpg; *.jpeg; *.bmp ; *.png|Bitmap Files (*.bmp)|*.bmp|PNG Files (*.png)|*.png|JPEG Files (*.jpg;*.jpeg)|*.jpg; *.jpeg||", this); 



如果文件扩展名是.jpg或.JPG或.jPG或.JPg等,在这里应该可以使用.
我不想手动执行此操作,是否有任何通用方法可以执行此操作. ??

我紧急需要此修复程序.请更新.
Thanx:)



Here this should work if the file extension is .jpg or .JPG or .jPG or .JPg ,etc.
I don''t want to do it manually.Is there any generic way for doing this. ??

I need the fix little urgently.Please update.
Thanx :)

推荐答案

嘿,您正在Windows上工作.
它不区分大小写.仅提供.jpg文件,其余的将留存.无需执行任何操作.
Hey you are working on Windows.
It is not case sensitive. Give only .jpg, it will take the rest. Nothing you need to do.


您拥有代码的方式将像这样工作.
您没有尝试过吗?
The way you have the code will work like that.
Haven''t you tried it?


这篇关于在不同情况下使用文件扩展名加载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆