如何在File.exists()方法中使用文件路径(嵌入在c#.net windows项目中)? [英] How to use file path (which is embedded in c#.net windows project) in File.exists() method?
本文介绍了如何在File.exists()方法中使用文件路径(嵌入在c#.net windows项目中)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在File.exists()方法中使用文件路径(嵌入在c#.net windows项目中)?有没有办法做到这一点?
解决方案
你可以使用Assembly.GetManifestResourceNames
方法 [ ^ ]它将返回数组包含所有资源的名称。
检查该数组是否存在您的搜索文件。
参考我如何发现嵌入式资源的路径? [ ^ ]
How to use file path (which is embedded in c#.net windows project) in File.exists() method? Is there any way to do this?
解决方案
you can useAssembly.GetManifestResourceNames
Method[^] it will return array that contains the names of all the resources.
check on that array whether your searching file exist or not.
refer How can I discover the "path" of an embedded resource?[^]
这篇关于如何在File.exists()方法中使用文件路径(嵌入在c#.net windows项目中)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文