c# - Get all images from a folder in my project/solution -
a quick question.
how in easiest , securest way images folder in solution without having copy them debug folder.
so lets folder structure:
project resources (folder) images (folder) helpicons (folder) icon1.png icon2.png
how icon1 , icon2 code? (without copy debug)
you can use getfiles directory specified.
string[] filenames = system.io.directory.getfiles("project\\resources\\images\\helpicons");
filenames
contains list of filenames in directory, here can ".png"
--edit 12:13--
this starting directory executable is. can specify full path if needed.
string[] filenames = system.io.directory.getfiles("c:\\project\\resources\\images\\helpicons");
Comments
Post a Comment