gpt4 book ai didi

c# - 如何获取任何文件/文件夹的系统图标

转载 作者:行者123 更新时间:2023-12-05 04:18:04 24 4
gpt4 key购买 nike

如何检索与文件/文件夹关联的系统图标,以便我可以在文件/文件夹名称旁边的 ListView 中显示它吗?

最佳答案

你需要使用Icon.ExtractAssociatedIcon

 Icon icon = Icon.ExtractAssociatedIcon(filepath);

看看Icon.ExtractAssociatedIcon文档

注意:这仅适用于文件。对于文件夹,您需要 P/Invoke sample is here 编辑:页面现已失效,请引用this copy on the Wayback Machine .

关于c# - 如何获取任何文件/文件夹的系统图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18444079/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com