读取资源中文件的扩展名

编程入门 行业动态 更新时间:2024-10-10 13:14:36
本文介绍了读取资源中文件的扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何编写代码来读取My.Resources 文件的扩展名?

How can I write a code to read the extension of a My.Resources file?

示例:

如果我的资源中有一个名为 IMG.JPEG 的文件

if i have a file named IMG.JPEG in my resources

如何让msgbox显示扩展名.JPEG?

How can I make msgbox to show the extension .JPEG ?

我可以显示文件名但没有扩展名

I can show the file name but without extension with this

For Each Fe In My.Resources.ResourceManager.GetResourceSet _ (System.Globalization.CultureInfo.CurrentCulture, False, True) MsgBox(Fe.Key) Next

任何帮助将不胜感激

我可以得到文件的扩展名,但是作为 .BYTE[] 和图片作为 .Bitmap 和这个代码

I can get the extension of file but as .BYTE[] and pictures as .Bitmap with this code

GT = Path.GetExtension(My.Resources.ResourceManager.GetObject(Fe.Key).ToString) MsgBox(GT)

如何获取原始扩展名?

推荐答案

如果你有你只需要的文件名:

If you have the filename you just need:

sExt = System.IO.Path.GetExtension(sFileName)

或者:

sExt = sFileName.SubString(sFileName.LastIndexOf("."c))

更多推荐

读取资源中文件的扩展名

本文发布于:2023-11-13 06:07:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583651.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:扩展名   文件   资源

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!